summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-02-02 00:08:35 +0000
committerGerald Carter <jerry@samba.org>2004-02-02 00:08:35 +0000
commit19cc1a9f202551fdaca39d67d926bb77e32d085c (patch)
tree4214654f0954461188f94e61351ecfb90b623430 /source3/rpc_server
parent4c49368dbce34fd5f2671c9974d521466592cda9 (diff)
downloadsamba-19cc1a9f202551fdaca39d67d926bb77e32d085c.tar.gz
samba-19cc1a9f202551fdaca39d67d926bb77e32d085c.tar.bz2
samba-19cc1a9f202551fdaca39d67d926bb77e32d085c.zip
remerge andrew's cracklib patch from HEAD and fix a compile warnings
(This used to be commit b60f6ec30d05e4e5bba9934a416ddc8bc089824f)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c17
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 bcb5b239be..b8de24cf39 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;
}