summaryrefslogtreecommitdiffstats
path: root/source3/smbd/lanman.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-04 08:45:17 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-04 08:45:17 +0000
commite3ed8eaa2fd47a72c7b89d769ee594f238130ff7 (patch)
treeb39494a155ac00e8502cc2fec09e6f83474576f4 /source3/smbd/lanman.c
parent1bb969520392ea41b1c6841af2164bbca01381fe (diff)
downloadsamba-e3ed8eaa2fd47a72c7b89d769ee594f238130ff7.tar.gz
samba-e3ed8eaa2fd47a72c7b89d769ee594f238130ff7.tar.xz
samba-e3ed8eaa2fd47a72c7b89d769ee594f238130ff7.zip
Merge from HEAD - move user password changes into the NTSTATUS era, and add
suppport for the 'min password age' and 'min passwd len' concepts. (This used to be commit d9417b08d1b649e598b44135bc57008f4e4f7769)
Diffstat (limited to 'source3/smbd/lanman.c')
-rw-r--r--source3/smbd/lanman.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 7a667c378dc..61288e01671 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -1930,25 +1930,7 @@ static BOOL api_SetUserPassword(connection_struct *conn,uint16 vuid, char *param
DATA_BLOB password = data_blob(pass1, strlen(pass1)+1);
if (NT_STATUS_IS_OK(check_plaintext_password(user,password,&server_info))) {
- /*
- * If unix password sync was requested, attempt to change
- * the /etc/passwd database first. Return failure if this cannot
- * be done.
- *
- * This occurs before the oem change, becouse we don't want to
- * update it if chgpasswd failed.
- *
- * Conditional on lp_unix_password_sync() becouse we don't want
- * to touch the unix db unless we have admin permission.
- */
-
- if(lp_unix_password_sync() && IS_SAM_UNIX_USER(server_info->sam_account)
- && !chgpasswd(pdb_get_username(server_info->sam_account),
- pass1,pass2,False)) {
- SSVAL(*rparam,0,NERR_badpass);
- }
-
- if (change_oem_password(server_info->sam_account,pass2))
+ if (NT_STATUS_IS_OK(change_oem_password(server_info->sam_account, pass1, pass2)))
{
SSVAL(*rparam,0,NERR_Success);
}
@@ -2031,7 +2013,7 @@ static BOOL api_SamOEMChangePassword(connection_struct *conn,uint16 vuid, char *
(void)map_username(user);
- if (pass_oem_change(user, (uchar*) data, (uchar *)&data[516], NULL, NULL))
+ if (NT_STATUS_IS_OK(pass_oem_change(user, (uchar*) data, (uchar *)&data[516], NULL, NULL)))
{
SSVAL(*rparam,0,NERR_Success);
}