s3: Fix pam_authenticate() when lp_null_passwords() is true
authorMaks Naumov <maksqwe1@ukr.net>
Sun, 3 May 2015 10:34:49 +0000 (13:34 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 4 May 2015 16:24:21 +0000 (18:24 +0200)
(PAM_SILENT | lp_null_passwords() ? 0 : PAM_DISALLOW_NULL_AUTHTOK)
is always 0 when lp_null_passwords() == true.

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/auth/pampass.c

index bde7c2262508008fddf8cfd47d4ca7156e5af3ed..2a3195c8b427bcede8aa84b344c8b59023bdc228 100644 (file)
@@ -524,7 +524,7 @@ static NTSTATUS smb_pam_auth(pam_handle_t *pamh, const char *user)
         */
 
        DEBUG(4,("smb_pam_auth: PAM: Authenticate User: %s\n", user));
-       pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords() ? 0 : PAM_DISALLOW_NULL_AUTHTOK);
+       pam_error = pam_authenticate(pamh, PAM_SILENT | (lp_null_passwords() ? 0 : PAM_DISALLOW_NULL_AUTHTOK));
        switch( pam_error ){
                case PAM_AUTH_ERR:
                        DEBUG(2, ("smb_pam_auth: PAM: Authentication Error for user %s\n", user));