Remove the ugly hacks to get around the Get_Pwnam() calls in pass_check.c by
[gd/samba-autobuild/.git] / source3 / passdb / pass_check.c
index 59fc9e2eac879f956da7b039e57beca7a3f72964..7426bfcbe3103d053b893cc2ac7c5ed5157ee1ff 100644 (file)
@@ -682,12 +682,11 @@ match is found and is used to update the encrypted password file
 return True on correct match, False otherwise
 ****************************************************************************/
 
-BOOL pass_check(char *user, char *password, int pwlen, 
-               BOOL (*fn) (char *, char *))
+BOOL pass_check(struct passwd *pass, char *user, char *password, int pwlen, 
+               BOOL (*fn) (char *, char *), BOOL run_cracker)
 {
        pstring pass2;
        int level = lp_passwordlevel();
-       struct passwd *pass = NULL;
 
        if (password)
                password[pwlen] = 0;
@@ -702,8 +701,6 @@ BOOL pass_check(char *user, char *password, int pwlen,
        if (((!*password) || (!pwlen)) && !lp_null_passwords())
                return (False);
 
-       pass = Get_Pwnam(user, True);
-
 #ifdef WITH_PAM
 
        /*
@@ -819,6 +816,10 @@ BOOL pass_check(char *user, char *password, int pwlen,
                return (True);
        }
 
+       if (!run_cracker) {
+               return False;
+       }
+
        /* if the password was given to us with mixed case then we don't
           need to proceed as we know it hasn't been case modified by the
           client */