added SAMR_USER_INFO_24 info level to samr_set_userinfo. this is used
authorLuke Leighton <lkcl@samba.org>
Thu, 25 Mar 1999 15:14:30 +0000 (15:14 +0000)
committerLuke Leighton <lkcl@samba.org>
Thu, 25 Mar 1999 15:14:30 +0000 (15:14 +0000)
by "Welcome to SAMBA Domain".
(This used to be commit 4aed18b5e1e2309c0f6931fbfdd604b01cb9498a)

source3/include/proto.h
source3/include/rpc_samr.h
source3/rpc_parse/parse_samr.c
source3/rpc_server/srv_samr.c

index 8e8e7e292a9834f3b66f84afcc20741360b3b941..96385144a66c255ce99cb8234c5dc9478d89363d 100644 (file)
@@ -2476,6 +2476,8 @@ void make_sam_user_info11(SAM_USER_INFO_11 *usr,
                                uint32 rid_group,
                                uint16 acct_ctrl);
 void sam_io_user_info11(char *desc,  SAM_USER_INFO_11 *usr, prs_struct *ps, int depth);
                                uint32 rid_group,
                                uint16 acct_ctrl);
 void sam_io_user_info11(char *desc,  SAM_USER_INFO_11 *usr, prs_struct *ps, int depth);
+void make_sam_user_info_24(SAM_USER_INFO_24 *usr,
+       char newpass[516]);
 void make_sam_user_info23(SAM_USER_INFO_23 *usr,
 
        NTTIME *logon_time, /* all zeros */
 void make_sam_user_info23(SAM_USER_INFO_23 *usr,
 
        NTTIME *logon_time, /* all zeros */
index 92125f9f2c1d578748e950692400318cd1182c3a..9a62bd4b97efcd6de6736412bcb16b85ea282199 100644 (file)
@@ -200,6 +200,13 @@ typedef struct sam_user_info_23
 
 } SAM_USER_INFO_23;
 
 
 } SAM_USER_INFO_23;
 
+/* SAM_USER_INFO_24 */
+typedef struct sam_user_info_24
+{
+       uint8 pass[516];
+
+} SAM_USER_INFO_24;
+
 
 /* SAM_USER_INFO_21 */
 typedef struct sam_user_info_21
 
 /* SAM_USER_INFO_21 */
 typedef struct sam_user_info_21
@@ -1116,6 +1123,7 @@ typedef struct q_samr_set_user_info
        union
        {
                SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
        union
        {
                SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
+               SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
                void* id; /* to make typecasting easy */
 
        } info;
                void* id; /* to make typecasting easy */
 
        } info;
index f724535a8cfd5d50ababe3a30422dc5636d61cb5..09c881a812f7e11630994a350b477ab3bf17ca26 100644 (file)
@@ -4105,6 +4105,37 @@ void sam_io_user_info11(char *desc,  SAM_USER_INFO_11 *usr, prs_struct *ps, int
        prs_uint8s (False, "padding_9", ps, depth, usr->padding_9, sizeof(usr->padding_9));
 }
 
        prs_uint8s (False, "padding_9", ps, depth, usr->padding_9, sizeof(usr->padding_9));
 }
 
+/*************************************************************************
+ make_sam_user_infoa
+
+ unknown_3 = 0x09f8 27fa
+ unknown_5 = 0x0001 0000
+ unknown_6 = 0x0000 04ec 
+
+ *************************************************************************/
+void make_sam_user_info_24(SAM_USER_INFO_24 *usr,
+       char newpass[516])
+{
+       memcpy(usr->pass, newpass, sizeof(usr->pass));
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+static void sam_io_user_info_24(char *desc,  SAM_USER_INFO_24 *usr, prs_struct *ps, int depth)
+{
+       if (usr == NULL) return;
+
+       prs_debug(ps, depth, desc, "lsa_io_user_info");
+       depth++;
+
+       prs_align(ps);
+       
+       prs_uint8s (False, "password", ps, depth, usr->pass, sizeof(usr->pass));
+       prs_align(ps);
+}
+
+
 /*************************************************************************
  make_sam_user_info23
 
 /*************************************************************************
  make_sam_user_info23
 
@@ -4606,6 +4637,13 @@ void make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u,
 
        switch (switch_value)
        {
 
        switch (switch_value)
        {
+               case 0x18:
+               {
+                       q_u->info.id24 = (SAM_USER_INFO_24*)info;
+
+                       break;
+               }
+
                case 0x17:
                {
                        q_u->info.id23 = (SAM_USER_INFO_23*)info;
                case 0x17:
                {
                        q_u->info.id23 = (SAM_USER_INFO_23*)info;
@@ -4648,6 +4686,17 @@ void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps
                {
                        break;
                }
                {
                        break;
                }
+               case 24:
+               {
+                       q_u->info.id = Realloc(NULL, sizeof(*q_u->info.id24));
+                       if (q_u->info.id == NULL)
+                       {
+                               DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n"));
+                               return;
+                       }
+                       sam_io_user_info_24("", q_u->info.id24, ps, depth);
+                       break;
+               }
                case 23:
                {
                        q_u->info.id = Realloc(NULL, sizeof(*q_u->info.id23));
                case 23:
                {
                        q_u->info.id = Realloc(NULL, sizeof(*q_u->info.id23));
index 2437163f2b0c9b1a362794e7203950c0c3add7d9..b0fc64a2e7d360c901019e83480d1f84fc355826 100644 (file)
@@ -1943,6 +1943,27 @@ static void samr_reply_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u,
 
 }
 
 
 }
 
+/*******************************************************************
+ set_user_info_24
+ ********************************************************************/
+static BOOL set_user_info_24(SAM_USER_INFO_24 *id24, uint32 rid)
+{
+       static struct sam_passwd *pwd;
+       fstring new_pw;
+       if (!decode_pw_buffer(id24->pass, new_pw, sizeof(new_pw), True))
+       {
+               return False;
+       }
+#ifdef DEBUG_PASSWORD
+       DEBUG(0,("New Password: %s\n", new_pw));
+#endif
+#if 0
+       return mod_sam21pwd_entry(&pwd, True);
+#else
+       return True;
+#endif
+}
+
 /*******************************************************************
  set_user_info_23
  ********************************************************************/
 /*******************************************************************
  set_user_info_23
  ********************************************************************/
@@ -2007,6 +2028,15 @@ static void samr_reply_set_userinfo(SAMR_Q_SET_USERINFO *q_u,
        {
                switch (q_u->switch_value)
                {
        {
                switch (q_u->switch_value)
                {
+                       case 24:
+                       {
+                               SAM_USER_INFO_24 *id24 = q_u->info.id24;
+                               nt_lm_owf_gen("test", nt_pwd, lm_pwd);
+                               SamOEMhash(id24->pass, user_sess_key, True);
+                               status = set_user_info_24(id24, rid) ? 0 : (0xC0000000 | NT_STATUS_ACCESS_DENIED);
+                               break;
+                       }
+
                        case 23:
                        {
                                SAM_USER_INFO_23 *id23 = q_u->info.id23;
                        case 23:
                        {
                                SAM_USER_INFO_23 *id23 = q_u->info.id23;