mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
configure CC support, strrchr over rindex
This commit is contained in:
parent
5ae15317c6
commit
9c3feee9b6
5 changed files with 27 additions and 18 deletions
5
CHANGES
5
CHANGES
|
@ -1,6 +1,11 @@
|
|||
Changelog for hydra
|
||||
-------------------
|
||||
|
||||
Release 8.5-dev
|
||||
* ./configure now honors the CC enviroment variable if present
|
||||
* Favor strrchr() over rindex()
|
||||
|
||||
|
||||
Release 8.4
|
||||
! Reports came in that the rdp module is not working reliable sometimes, most likely against new Windows versions. please test, report and if possible send a fix
|
||||
* Proxy support re-implemented:
|
||||
|
|
26
configure
vendored
26
configure
vendored
|
@ -15,9 +15,13 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
|||
echo " --nostrip do not per default strip binaries before install"
|
||||
echo " --debug show debug output to trace errors"
|
||||
echo " --help this here"
|
||||
echo
|
||||
echo If the CC environment variable is set, this is used as the compiler for the configure tests. The default is \"gcc\" otherwise.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
test -z "$CC" && CC=gcc
|
||||
|
||||
FHS=""
|
||||
SIXFOUR=""
|
||||
DEBUG=""
|
||||
|
@ -966,37 +970,37 @@ fi
|
|||
|
||||
echo "Checking for Android specialities ..."
|
||||
TMPC=comptest$$
|
||||
RINDEX=" not"
|
||||
STRRCHR=" not"
|
||||
echo '#include <stdio.h>' > $TMPC.c
|
||||
echo '#include <strings.h>' >> $TMPC.c
|
||||
echo "int main() { char *x = rindex(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c
|
||||
gcc -o $TMPC $TMPC.c > /dev/null 2>&1
|
||||
test -x $TMPC && RINDEX=""
|
||||
echo "int main() { char *x = strrchr(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c
|
||||
$CC -o $TMPC $TMPC.c > /dev/null 2>&1
|
||||
test -x $TMPC && STRRCHR=""
|
||||
rm -f $TMPC $TMPC.c
|
||||
echo " ... rindex()$RINDEX found"
|
||||
echo " ... strrchr()$STRRCHR found"
|
||||
if [ -n "$CRYPTO_PATH" ]; then
|
||||
RSA=" not"
|
||||
echo '#include <stdio.h>' > $TMPC.c
|
||||
echo '#include <openssl/rsa.h>' >> $TMPC.c
|
||||
echo "int main() { RSA *rsa = RSA_generate_key(1024, RSA_F4, NULL, NULL); if (rsa == NULL) return 0; else return 1; }" >> $TMPC.c
|
||||
#echo "int main() { RSA *rsa; RSA_generate_key_ex(rsa, 1024, 0, NULL); if (rsa == NULL) return 0; else return 1; }" >> $TMPC.c
|
||||
gcc -o $TMPC $TMPC.c -lssl -lcrypto > /dev/null 2>&1
|
||||
$CC -o $TMPC $TMPC.c -lssl -lcrypto > /dev/null 2>&1
|
||||
test -x $TMPC && RSA=""
|
||||
rm -f $TMPC $TMPC.c
|
||||
echo " ... RSA_generate_key()$RSA found"
|
||||
fi
|
||||
|
||||
echo "Checking for secure compile option support in gcc ..."
|
||||
echo "Checking for secure compile option support in $CC ..."
|
||||
GCCSEC="no"
|
||||
LDSEC="no"
|
||||
GCCSECOPT="-fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
|
||||
echo '#include <stdio.h>' > $TMPC.c
|
||||
echo 'int main() { printf(""); return 0; }' >> $TMPC.c
|
||||
gcc -pie -fPIE $GCCSEPOPT -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err
|
||||
$CC -pie -fPIE $GCCSEPOPT -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err
|
||||
test -x $TMPC && GCCSEC="yes"
|
||||
grep -q fPI $TMPC.c.err || GCCSECOPT="-pie -fPIE $GCCSECOPT"
|
||||
rm -f "$TMPC"
|
||||
gcc $GCCSECOPT -Wl,-z,now -Wl,-z,relro -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err
|
||||
$CC $GCCSECOPT -Wl,-z,now -Wl,-z,relro -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err
|
||||
test -x $TMPC && { LDSEC="yes" ; GCCSECOPT="$GCCSECOPT -Wl,-z,now -Wl,-z,relro" ; }
|
||||
rm -f $TMPC $TMPC.c $TMPC.c.err
|
||||
echo " Compiling... $GCCSEC"
|
||||
|
@ -1060,8 +1064,8 @@ fi
|
|||
if [ -n "$SSH_PATH" ]; then
|
||||
XDEFINES="$XDEFINES -DLIBSSH"
|
||||
fi
|
||||
if [ -n "$RINDEX" ]; then
|
||||
XDEFINES="$XDEFINES -DNO_RINDEX"
|
||||
if [ -n "$STRRCHR" ]; then
|
||||
XDEFINES="$XDEFINES -DNO_STRRCHR"
|
||||
fi
|
||||
if [ -n "$RSA" ]; then
|
||||
XDEFINES="$XDEFINES -DNO_RSA_LEGACY"
|
||||
|
|
|
@ -32,10 +32,10 @@ char *nntp_read_server_capacity(int sock) {
|
|||
buf[strlen(buf) - 1] = 0;
|
||||
if (buf[strlen(buf) - 1] == '\r')
|
||||
buf[strlen(buf) - 1] = 0;
|
||||
#ifdef NO_RINDEX
|
||||
if ((ptr = strrchr(buf, '\n')) != NULL) {
|
||||
#else
|
||||
#ifdef NO_STRRCHR
|
||||
if ((ptr = rindex(buf, '\n')) != NULL) {
|
||||
#else
|
||||
if ((ptr = strrchr(buf, '\n')) != NULL) {
|
||||
#endif
|
||||
ptr++;
|
||||
if (isdigit((int) *ptr) && *(ptr + 3) == ' ')
|
||||
|
|
|
@ -21,10 +21,10 @@ char *smtp_read_server_capacity(int sock) {
|
|||
buf[strlen(buf) - 1] = 0;
|
||||
if (buf[strlen(buf) - 1] == '\r')
|
||||
buf[strlen(buf) - 1] = 0;
|
||||
#ifdef NO_RINDEX
|
||||
if ((ptr = strrchr(buf, '\n')) != NULL) {
|
||||
#else
|
||||
#ifdef NO_STRRCHR
|
||||
if ((ptr = rindex(buf, '\n')) != NULL) {
|
||||
#else
|
||||
if ((ptr = strrchr(buf, '\n')) != NULL) {
|
||||
#endif
|
||||
ptr++;
|
||||
if (isdigit((int) *ptr) && *(ptr + 3) == ' ')
|
||||
|
|
2
hydra.c
2
hydra.c
|
@ -171,7 +171,7 @@ char *SERVICES =
|
|||
#define RESTOREFILE "./hydra.restore"
|
||||
|
||||
#define PROGRAM "Hydra"
|
||||
#define VERSION "v8.4"
|
||||
#define VERSION "v8.5-dev"
|
||||
#define AUTHOR "van Hauser/THC"
|
||||
#define EMAIL "<vh@thc.org>"
|
||||
#define RESOURCE "http://www.thc.org/thc-hydra"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue