summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-03-18 19:07:53 +0000
committerJeremy Allison <jra@samba.org>1998-03-18 19:07:53 +0000
commitda050244c305c1e03e2f3fb2ac02f6bc93ad47ca (patch)
treee6da7d243fd00f8fd4e9ade3fbbc191dfdd39cec /source3/smbd/ipc.c
parent002176a37597b51b4f5e482d9c5e6a8f6b39257f (diff)
downloadsamba-da050244c305c1e03e2f3fb2ac02f6bc93ad47ca.tar.gz
samba-da050244c305c1e03e2f3fb2ac02f6bc93ad47ca.tar.bz2
samba-da050244c305c1e03e2f3fb2ac02f6bc93ad47ca.zip
Added SamOEMChangePassword functionality.
Jeremy. (This used to be commit e02e3bcbbd4333113dde7bef47763fb229148007)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index bbeeb21e96..89b3e36f52 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -1663,6 +1663,65 @@ static BOOL api_SetUserPassword(int cnum,uint16 vuid, char *param,char *data,
}
/****************************************************************************
+ Set the user password (SamOEM version - gets plaintext).
+****************************************************************************/
+
+static BOOL api_SamOEMChangePassword(int cnum,uint16 vuid, char *param,char *data,
+ int mdrcnt,int mprcnt,
+ char **rdata,char **rparam,
+ int *rdata_len,int *rparam_len)
+{
+ fstring user;
+ fstring new_passwd;
+ struct smb_passwd *smbpw = NULL;
+ char *p = param + 2;
+
+ *rparam_len = 2;
+ *rparam = REALLOC(*rparam,*rparam_len);
+
+ *rdata_len = 0;
+
+ SSVAL(*rparam,0,NERR_badpass);
+
+ /*
+ * Check the parameter definition is correct.
+ */
+ if(!strequal(param + 2, "zsT")) {
+ DEBUG(0,("api_SamOEMChangePassword: Invalid parameter string %sn\n", param + 2));
+ return False;
+ }
+ p = skip_string(p, 1);
+
+ if(!strequal(p, "B516B16")) {
+ DEBUG(0,("api_SamOEMChangePassword: Invalid data parameter string %sn\n", p));
+ return False;
+ }
+ p = skip_string(p,1);
+
+ fstrcpy(user,p);
+ p = skip_string(p,1);
+
+ if(check_oem_password( user, data, &smbpw, new_passwd, sizeof(new_passwd)) == False) {
+ return True;
+ }
+
+ /*
+ * At this point we have the new case-sensitive plaintext
+ * password in the fstring new_passwd. If we wanted to synchronise
+ * with UNIX passwords we would call a UNIX password changing
+ * function here. However it would have to be done as root
+ * as the plaintext of the old users password is not
+ * available. JRA.
+ */
+
+ if(change_oem_password( smbpw, new_passwd)) {
+ SSVAL(*rparam,0,NERR_Success);
+ }
+
+ return(True);
+}
+
+/****************************************************************************
delete a print job
Form: <W> <>
****************************************************************************/
@@ -3410,6 +3469,7 @@ struct
{"WPrintDriverEnum", 205, (BOOL (*)())api_WPrintDriverEnum,0},
{"WPrintQProcEnum", 206, (BOOL (*)())api_WPrintQProcEnum,0},
{"WPrintPortEnum", 207, (BOOL (*)())api_WPrintPortEnum,0},
+ {"SamOEMChangePassword", 214, (BOOL (*)())api_SamOEMChangePassword,0},
{NULL, -1, (BOOL (*)())api_Unsupported,0}};