r75: patch from Cal Heldenbrand <calzplace@yahoo.com> for 'pam_smbpass migrate'
authorGerald Carter <jerry@samba.org>
Tue, 6 Apr 2004 11:27:59 +0000 (11:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:07 +0000 (10:51 -0500)
(This used to be commit 673c3f8bc0343cce293bacbf0773212b53182d1d)

source3/pam_smbpass/pam_smb_auth.c

index 4452538d32c24cf2fd8a61be0897e4f86d1d0be5..d0dca6fa9209f8146f5f15c26faec9c051760be3 100644 (file)
@@ -217,10 +217,10 @@ static int _smb_add_user(pam_handle_t *pamh, unsigned int ctrl,
        return PAM_IGNORE;
    }
    else {
-    /* Change the user's password IFF it's null. */
-    if ((pdb_get_lanman_passwd(sampass) == NULL) && (pdb_get_acct_ctrl(sampass) & ACB_PWNOTREQ))
+    /* mimick 'update encrypted' as long as the 'no pw req' flag is not set */
+    if ( pdb_get_acct_ctrl(sampass) & ~ACB_PWNOTREQ )
     {
-       retval = local_password_change( name, 0, pass, err_str, sizeof(err_str),
+       retval = local_password_change( name, LOCAL_SET_PASSWORD, pass, err_str, sizeof(err_str),
                                         msg_str, sizeof(msg_str) );
        if (!retval && *err_str)
        {