From a4276507e43487f47445eab11d4ac1b080b3270e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 May 1998 01:30:40 +0000 Subject: chgpasswd.c: Added comments to #ifdefs ipc.c: Caused samba password changing not to be done if UNIX password changing requested and not successful. util.c: Added string_to_sid() and sid_to_string() functions. lib/rpc/client/cli_samr.c: lib/rpc/include/rpc_misc.h: lib/rpc/parse/parse_lsa.c: lib/rpc/parse/parse_misc.c: lib/rpc/parse/parse_net.c: lib/rpc/parse/parse_samr.c: lib/rpc/server/srv_lsa.c: lib/rpc/server/srv_lsa_hnd.c: lib/rpc/server/srv_netlog.c: lib/rpc/server/srv_samr.c: lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs around as char *, they are converted to DOM_SID at the earliest opportunity, and passed around as that. Also added dynamic memory allocation of group sids. Preparing to auto-generate machine sid. Jeremy. (This used to be commit 134d6fa79c1b6b9505a2c84ba9bfb91dd3be76e5) --- source3/smbd/chgpasswd.c | 4 ++-- source3/smbd/ipc.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index d900b54c1f..ece3107257 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -427,13 +427,13 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root) return(chat_with_program(passwordprogram,name,chatsequence, as_root)); } -#else +#else /* ALLOW_CHANGE_PASSWORD */ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root) { DEBUG(0,("Password changing not compiled in (user=%s)\n",name)); return(False); } -#endif +#endif /* ALLOW_CHANGE_PASSWORD */ /*********************************************************** Code to check the lanman hashed password. diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 7b82894c7f..132fdb30ef 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -1677,6 +1677,7 @@ static BOOL api_SamOEMChangePassword(int cnum,uint16 vuid, char *param,char *dat fstring new_passwd; struct smb_passwd *sampw = NULL; char *p = param + 2; + int ret = True; *rparam_len = 2; *rparam = REALLOC(*rparam,*rparam_len); @@ -1718,9 +1719,9 @@ static BOOL api_SamOEMChangePassword(int cnum,uint16 vuid, char *param,char *dat */ if(lp_unix_password_sync()) - chgpasswd(user,"", new_passwd, True); + ret = chgpasswd(user,"", new_passwd, True); - if(change_oem_password( sampw, new_passwd, False)) { + if(ret && change_oem_password( sampw, new_passwd, False)) { SSVAL(*rparam,0,NERR_Success); } -- cgit