diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-01-12 12:18:11 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2004-01-12 12:18:11 +0000 |
commit | b75b755a2ba78ad323d6a87fdbee78b1829f864f (patch) | |
tree | e7864e978d01f52a6ef9ce5604cf9b178d427341 /source3/rpc_server | |
parent | 432f3be62ed7af5de3436bfc7b1ade4708c521f4 (diff) | |
download | samba-b75b755a2ba78ad323d6a87fdbee78b1829f864f.tar.gz samba-b75b755a2ba78ad323d6a87fdbee78b1829f864f.tar.bz2 samba-b75b755a2ba78ad323d6a87fdbee78b1829f864f.zip |
First stab at cracklib support (password quality checking) in Samba 3.0
This adds a configure test, that tries to find out if we have a working
cracklib installation, and tries to pick up the debian hints on where
the dictionary might be found. Default is per my Fedora Core 1 system -
I'm not sure how much it changes.
Andrew Bartlett
(This used to be commit bc770edb788f0b6f719011cda683f045b76b7ba5)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index b9974cba8a..7edd34c8dd 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2834,11 +2834,17 @@ static BOOL set_user_info_23(SAM_USER_INFO_23 *id23, DOM_SID *sid) DEBUG(5, ("Changing trust account or non-unix-user password, not updating /etc/passwd\n")); } else { /* update the UNIX password */ - if (lp_unix_password_sync() ) - if(!chgpasswd(pdb_get_username(pwd), "", plaintext_buf, True)) { + if (lp_unix_password_sync() ) { + struct passwd *passwd = Get_Pwnam(pdb_get_username(pwd)); + if (!passwd) { + DEBUG(1, ("chgpasswd: Username does not exist in system !?!\n")); + } + + if(!chgpasswd(pdb_get_username(pwd), passwd, "", plaintext_buf, True)) { pdb_free_sam(&pwd); return False; } + } } ZERO_STRUCT(plaintext_buf); @@ -2899,7 +2905,12 @@ static BOOL set_user_info_pw(char *pass, DOM_SID *sid) } else { /* update the UNIX password */ if (lp_unix_password_sync()) { - if(!chgpasswd(pdb_get_username(pwd), "", plaintext_buf, True)) { + struct passwd *passwd = Get_Pwnam(pdb_get_username(pwd)); + if (!passwd) { + DEBUG(1, ("chgpasswd: Username does not exist in system !?!\n")); + } + + if(!chgpasswd(pdb_get_username(pwd), passwd, "", plaintext_buf, True)) { pdb_free_sam(&pwd); return False; } |