diff --git a/auth.c b/auth.c index f5b7aa0..985eee4 100644 --- a/auth.c +++ b/auth.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "ldap.h" #include "auth.h" #include @@ -31,7 +32,7 @@ int check_password(const char* fromdb,struct string* plaintext) { if (str_equal(md5,fromdb+5)) return 1; } - if (plaintext->l<100 && (str_start(fromdb,"$1$") || strlen(fromdb)==13)) { + if (plaintext->l<100 && ((fromdb[0]=='$' && fromdb[2]=='$' && isdigit(fromdb[1])) || strlen(fromdb)==13)) { char* c=alloca(plaintext->l+1); byte_copy(c,plaintext->l,plaintext->s); c[plaintext->l]=0;