r8564: Sometimes we're too dumb to live... Fix samr calls where we were
authorJeremy Allison <jra@samba.org>
Tue, 19 Jul 2005 00:59:25 +0000 (00:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:00:09 +0000 (11:00 -0500)
using USER_INFO_XX structs and functions where XX was sometimes
in hex and sometimes in decimal. Now it's all in decimal (should
be no functionality change).
Jeremy.

source/include/rpc_samr.h
source/python/py_samr.c
source/python/py_samr.h
source/python/py_samr_conv.c
source/rpc_parse/parse_samr.c
source/rpc_server/srv_samr_nt.c
source/utils/net_rpc_join.c

index adf410188090865c5de8e091a6f2ecf32a372295..fb829558d442e61ee499ac0cc4e2e2881ac33f81 100644 (file)
@@ -351,8 +351,8 @@ typedef struct sam_user_info_20
 
 } SAM_USER_INFO_20;
 
-/* SAM_USER_INFO_12 */
-typedef struct sam_user_info_12
+/* SAM_USER_INFO_18 */
+typedef struct sam_user_info_18
 {
        uint8 lm_pwd[16];    /* lm user passwords */
        uint8 nt_pwd[16];    /* nt user passwords */
@@ -360,10 +360,10 @@ typedef struct sam_user_info_12
        uint8 lm_pwd_active; 
        uint8 nt_pwd_active; 
 
-} SAM_USER_INFO_12;
+} SAM_USER_INFO_18;
 
-/* SAM_USER_INFO_11 */
-typedef struct sam_user_info_11
+/* SAM_USER_INFO_17 */
+typedef struct sam_user_info_17
 {
        uint8  padding_0[16];  /* 0 - padding 16 bytes */
        NTTIME expiry;         /* expiry time or something? */
@@ -398,15 +398,15 @@ typedef struct sam_user_info_11
 
        uint8  padding_9[48];  /* 0 - padding 48 bytes */
 
-} SAM_USER_INFO_11;
+} SAM_USER_INFO_17;
 
 
-/* SAM_USER_INFO_10 */
-typedef struct sam_user_info_10
+/* SAM_USER_INFO_16 */
+typedef struct sam_user_info_16
 {
        uint32 acb_info;
 
-} SAM_USER_INFO_10;
+} SAM_USER_INFO_16;
 
 /* SAM_USER_INFO_7 */
 typedef struct sam_user_info_7
@@ -1254,15 +1254,15 @@ typedef struct sam_userinfo_ctr_info
 
        union
        {
-               SAM_USER_INFO_7  *id7;  /* auth-level 0x07 */
-               SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
-               SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
-               SAM_USER_INFO_12 *id12; /* auth-level 0x12 */
-               SAM_USER_INFO_20 *id20; /* auth-level 20 */
-               SAM_USER_INFO_21 *id21; /* auth-level 21 */
-               SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
-               SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
-               SAM_USER_INFO_25 *id25; /* auth-level 0x19 */
+               SAM_USER_INFO_7  *id7;
+               SAM_USER_INFO_16 *id16;
+               SAM_USER_INFO_17 *id17;
+               SAM_USER_INFO_18 *id18;
+               SAM_USER_INFO_20 *id20;
+               SAM_USER_INFO_21 *id21;
+               SAM_USER_INFO_23 *id23;
+               SAM_USER_INFO_24 *id24;
+               SAM_USER_INFO_25 *id25;
                void* id; /* to make typecasting easy */
 
        } info;
index 57acd74bedb138c5d45d4c4e073cb2751385312b..77431e244755ead4cac02fb804f8781e4d2b0865 100644 (file)
@@ -146,7 +146,7 @@ static PyObject *samr_set_user_info2(PyObject *self, PyObject *args,
        NTSTATUS ntstatus;
        int level;
        union {
-               SAM_USER_INFO_10 id10;
+               SAM_USER_INFO_16 id16;
                SAM_USER_INFO_21 id21;
        } pinfo;
 
@@ -164,10 +164,10 @@ static PyObject *samr_set_user_info2(PyObject *self, PyObject *args,
        ctr.switch_value = level;
 
        switch(level) {
-       case 0x10:
-               ctr.info.id10 = &pinfo.id10;
+       case 16:
+               ctr.info.id16 = &pinfo.id16;
                
-               if (!py_to_SAM_USER_INFO_10(ctr.info.id10, info)) {
+               if (!py_to_SAM_USER_INFO_16(ctr.info.id16, info)) {
                        PyErr_SetString(
                                samr_error, "error converting user info");
                        goto done;
index 4d2b0675b477deb9cabe7fd541a84f471c8e9843..8e91b1671ec3f45db31308e15eefac0b9ae904d8 100644 (file)
@@ -78,8 +78,8 @@ extern PyObject *samr_error;
 /* The following definitions are from py_samr_conv.c */
 
 BOOL py_from_acct_info(PyObject **array, struct acct_info *info, int num_accts);
-BOOL py_from_SAM_USER_INFO_10(PyObject **dict, SAM_USER_INFO_10 *info);
-BOOL py_to_SAM_USER_INFO_10(SAM_USER_INFO_10 *info, PyObject *dict);
+BOOL py_from_SAM_USER_INFO_16(PyObject **dict, SAM_USER_INFO_16 *info);
+BOOL py_to_SAM_USER_INFO_16(SAM_USER_INFO_16 *info, PyObject *dict);
 BOOL py_from_SAM_USER_INFO_21(PyObject **dict, SAM_USER_INFO_21 *info);
 BOOL py_to_SAM_USER_INFO_21(SAM_USER_INFO_21 *info, PyObject *dict);
 
index 7523ee7dfcbcb3206d57fb37b3b66fabd7827162..94bedcf779ee936f63d77e5707f13b16f4db6244 100644 (file)
 #include "python/py_conv.h"
 
 /*
- * Convert between SAM_USER_INFO_10 and Python
+ * Convert between SAM_USER_INFO_16 and Python
  */
 
-struct pyconv py_SAM_USER_INFO_10[] = {
-       { "acb_info", PY_UINT32, offsetof(SAM_USER_INFO_10, acb_info) },
+struct pyconv py_SAM_USER_INFO_16[] = {
+       { "acb_info", PY_UINT32, offsetof(SAM_USER_INFO_16, acb_info) },
        { NULL }
 };
 
-BOOL py_from_SAM_USER_INFO_10(PyObject **dict, SAM_USER_INFO_10 *info)
+BOOL py_from_SAM_USER_INFO_16(PyObject **dict, SAM_USER_INFO_16 *info)
 {
-       *dict = from_struct(info, py_SAM_USER_INFO_10);
-       PyDict_SetItemString(*dict, "level", PyInt_FromLong(0x10));
+       *dict = from_struct(info, py_SAM_USER_INFO_16);
+       PyDict_SetItemString(*dict, "level", PyInt_FromLong(16));
        return True;
 }
 
-BOOL py_to_SAM_USER_INFO_10(SAM_USER_INFO_10 *info, PyObject *dict)
+BOOL py_to_SAM_USER_INFO_16(SAM_USER_INFO_16 *info, PyObject *dict)
 {
        PyObject *obj, *dict_copy = PyDict_Copy(dict);
        BOOL result = False;
@@ -48,7 +48,7 @@ BOOL py_to_SAM_USER_INFO_10(SAM_USER_INFO_10 *info, PyObject *dict)
 
        PyDict_DelItemString(dict_copy, "level");
 
-       if (!to_struct(info, dict_copy, py_SAM_USER_INFO_10))
+       if (!to_struct(info, dict_copy, py_SAM_USER_INFO_16))
                goto done;
 
        result = True;
index ba8b367a425414d4b4edebd2fe0d4a9859a5b0f7..6b0193c6e46e58a402c000b58b8541c1185e09e6 100644 (file)
@@ -5103,13 +5103,13 @@ static BOOL sam_io_logon_hrs(const char *desc, LOGON_HRS * hrs,
 }
 
 /*******************************************************************
-inits a SAM_USER_INFO_12 structure.
+inits a SAM_USER_INFO_18 structure.
 ********************************************************************/
 
-void init_sam_user_info12(SAM_USER_INFO_12 * usr,
+void init_sam_user_info18(SAM_USER_INFO_18 * usr,
                          const uint8 lm_pwd[16], const uint8 nt_pwd[16])
 {
-       DEBUG(5, ("init_sam_user_info12\n"));
+       DEBUG(5, ("init_sam_user_info18\n"));
 
        usr->lm_pwd_active =
                memcpy(usr->lm_pwd, lm_pwd, sizeof(usr->lm_pwd)) ? 1 : 0;
@@ -5121,13 +5121,13 @@ void init_sam_user_info12(SAM_USER_INFO_12 * usr,
 reads or writes a structure.
 ********************************************************************/
 
-static BOOL sam_io_user_info12(const char *desc, SAM_USER_INFO_12 * u,
+static BOOL sam_io_user_info18(const char *desc, SAM_USER_INFO_18 * u,
                        prs_struct *ps, int depth)
 {
        if (u == NULL)
                return False;
 
-       prs_debug(ps, depth, desc, "samr_io_r_user_info12");
+       prs_debug(ps, depth, desc, "samr_io_r_user_info18");
        depth++;
 
        if(!prs_align(ps))
@@ -5185,12 +5185,12 @@ static BOOL sam_io_user_info7(const char *desc, SAM_USER_INFO_7 * usr,
 }
 
 /*******************************************************************
-inits a SAM_USER_INFO_10 structure.
+inits a SAM_USER_INFO_16 structure.
 ********************************************************************/
 
-void init_sam_user_info10(SAM_USER_INFO_10 * usr, uint32 acb_info)
+void init_sam_user_info16(SAM_USER_INFO_16 * usr, uint32 acb_info)
 {
-       DEBUG(5, ("init_sam_user_info10\n"));
+       DEBUG(5, ("init_sam_user_info16\n"));
 
        usr->acb_info = acb_info;
 }
@@ -5199,13 +5199,13 @@ void init_sam_user_info10(SAM_USER_INFO_10 * usr, uint32 acb_info)
 reads or writes a structure.
 ********************************************************************/
 
-static BOOL sam_io_user_info10(const char *desc, SAM_USER_INFO_10 * usr,
+static BOOL sam_io_user_info16(const char *desc, SAM_USER_INFO_16 * usr,
                        prs_struct *ps, int depth)
 {
        if (usr == NULL)
                return False;
 
-       prs_debug(ps, depth, desc, "samr_io_r_user_info10");
+       prs_debug(ps, depth, desc, "samr_io_r_user_info16");
        depth++;
 
        if(!prs_align(ps))
@@ -5218,15 +5218,15 @@ static BOOL sam_io_user_info10(const char *desc, SAM_USER_INFO_10 * usr,
 }
 
 /*******************************************************************
-inits a SAM_USER_INFO_11 structure.
+inits a SAM_USER_INFO_17 structure.
 ********************************************************************/
 
-void init_sam_user_info11(SAM_USER_INFO_11 * usr,
+void init_sam_user_info17(SAM_USER_INFO_17 * usr,
                          NTTIME * expiry,
                          char *mach_acct,
                          uint32 rid_user, uint32 rid_group, uint16 acct_ctrl)
 {
-       DEBUG(5, ("init_sam_user_info11\n"));
+       DEBUG(5, ("init_sam_user_info17\n"));
 
        memcpy(&usr->expiry, expiry, sizeof(usr->expiry));      /* expiry time or something? */
        ZERO_STRUCT(usr->padding_1);    /* 0 - padding 24 bytes */
@@ -5263,13 +5263,13 @@ void init_sam_user_info11(SAM_USER_INFO_11 * usr,
 reads or writes a structure.
 ********************************************************************/
 
-static BOOL sam_io_user_info11(const char *desc, SAM_USER_INFO_11 * usr,
+static BOOL sam_io_user_info17(const char *desc, SAM_USER_INFO_17 * usr,
                        prs_struct *ps, int depth)
 {
        if (usr == NULL)
                return False;
 
-       prs_debug(ps, depth, desc, "samr_io_r_unknown_11");
+       prs_debug(ps, depth, desc, "samr_io_r_unknown_17");
        depth++;
 
        if(!prs_align(ps))
@@ -6231,16 +6231,16 @@ NTSTATUS make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr,
        ctr->info.id = NULL;
 
        switch (switch_value) {
-       case 0x10:
-               ctr->info.id10 = TALLOC_ZERO_P(ctx,SAM_USER_INFO_10);
-               if (ctr->info.id10 == NULL)
+       case 16:
+               ctr->info.id16 = TALLOC_ZERO_P(ctx,SAM_USER_INFO_16);
+               if (ctr->info.id16 == NULL)
                        return NT_STATUS_NO_MEMORY;
 
-               init_sam_user_info10(ctr->info.id10, usr->acb_info);
+               init_sam_user_info16(ctr->info.id16, usr->acb_info);
                break;
 #if 0
 /* whoops - got this wrong.  i think.  or don't understand what's happening. */
-       case 0x11:
+       case 17:
                {
                        NTTIME expire;
                        info = (void *)&id11;
@@ -6248,8 +6248,8 @@ NTSTATUS make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr,
                        expire.low = 0xffffffff;
                        expire.high = 0x7fffffff;
 
-                       ctr->info.id = TALLOC_ZERO_P(ctx,SAM_USER_INFO_11);
-                       init_sam_user_info11(ctr->info.id11, &expire,
+                       ctr->info.id = TALLOC_ZERO_P(ctx,SAM_USER_INFO_17);
+                       init_sam_user_info11(ctr->info.id17, &expire,
                                             "BROOKFIELDS$",    /* name */
                                             0x03ef,    /* user rid */
                                             0x201,     /* group rid */
@@ -6258,12 +6258,12 @@ NTSTATUS make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr,
                        break;
                }
 #endif
-       case 0x12:
-               ctr->info.id12 = TALLOC_ZERO_P(ctx,SAM_USER_INFO_12);
-               if (ctr->info.id12 == NULL)
+       case 18:
+               ctr->info.id18 = TALLOC_ZERO_P(ctx,SAM_USER_INFO_18);
+               if (ctr->info.id18 == NULL)
                        return NT_STATUS_NO_MEMORY;
 
-               init_sam_user_info12(ctr->info.id12, usr->lm_pwd, usr->nt_pwd);
+               init_sam_user_info18(ctr->info.id18, usr->lm_pwd, usr->nt_pwd);
                break;
        case 21:
                {
@@ -6347,7 +6347,7 @@ static BOOL samr_io_userinfo_ctr(const char *desc, SAM_USERINFO_CTR **ppctr,
        ret = False;
 
        switch (ctr->switch_value) {
-       case 0x07:
+       case 7:
                if (UNMARSHALLING(ps))
                        ctr->info.id7 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_7,1);
                if (ctr->info.id7 == NULL) {
@@ -6356,34 +6356,34 @@ static BOOL samr_io_userinfo_ctr(const char *desc, SAM_USERINFO_CTR **ppctr,
                }
                ret = sam_io_user_info7("", ctr->info.id7, ps, depth);
                break;
-       case 0x10:
+       case 16:
                if (UNMARSHALLING(ps))
-                       ctr->info.id10 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_10,1);
-               if (ctr->info.id10 == NULL) {
+                       ctr->info.id16 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_16,1);
+               if (ctr->info.id16 == NULL) {
                        DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
                        return False;
                }
-               ret = sam_io_user_info10("", ctr->info.id10, ps, depth);
+               ret = sam_io_user_info16("", ctr->info.id16, ps, depth);
                break;
-       case 0x11:
+       case 17:
                if (UNMARSHALLING(ps))
-                       ctr->info.id11 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_11,1);
+                       ctr->info.id17 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_17,1);
 
-               if (ctr->info.id11 == NULL) {
+               if (ctr->info.id17 == NULL) {
                        DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
                        return False;
                }
-               ret = sam_io_user_info11("", ctr->info.id11, ps, depth);
+               ret = sam_io_user_info17("", ctr->info.id17, ps, depth);
                break;
-       case 0x12:
+       case 18:
                if (UNMARSHALLING(ps))
-                       ctr->info.id12 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_12,1);
+                       ctr->info.id18 = PRS_ALLOC_MEM(ps,SAM_USER_INFO_18,1);
 
-               if (ctr->info.id12 == NULL) {
+               if (ctr->info.id18 == NULL) {
                        DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
                        return False;
                }
-               ret = sam_io_user_info12("", ctr->info.id12, ps, depth);
+               ret = sam_io_user_info18("", ctr->info.id18, ps, depth);
                break;
        case 20:
                if (UNMARSHALLING(ps))
@@ -6588,12 +6588,12 @@ void init_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 * q_u,
                q_u->ctr->switch_value = switch_value;
 
        switch (switch_value) {
-       case 0x12:
-               SamOEMhashBlob(ctr->info.id12->lm_pwd, 16, sess_key);
-               SamOEMhashBlob(ctr->info.id12->nt_pwd, 16, sess_key);
+       case 18:
+               SamOEMhashBlob(ctr->info.id18->lm_pwd, 16, sess_key);
+               SamOEMhashBlob(ctr->info.id18->nt_pwd, 16, sess_key);
                dump_data(100, (char *)sess_key->data, sess_key->length);
-               dump_data(100, (char *)ctr->info.id12->lm_pwd, 16);
-               dump_data(100, (char *)ctr->info.id12->nt_pwd, 16);
+               dump_data(100, (char *)ctr->info.id18->lm_pwd, 16);
+               dump_data(100, (char *)ctr->info.id18->nt_pwd, 16);
                break;
        }
 }
index 9b98d4cb168a111131104d5814c87795db764476..2e73db280703a46379ac04a4bac1558860af1a7b 100644 (file)
@@ -1411,10 +1411,10 @@ static NTSTATUS get_user_info_7(TALLOC_CTX *mem_ctx, SAM_USER_INFO_7 *id7, DOM_S
        return NT_STATUS_OK;
 }
 /*************************************************************************
- get_user_info_10. Safe. Only gives out acb bits.
+ get_user_info_16. Safe. Only gives out acb bits.
  *************************************************************************/
 
-static NTSTATUS get_user_info_10(TALLOC_CTX *mem_ctx, SAM_USER_INFO_10 *id10, DOM_SID *user_sid)
+static NTSTATUS get_user_info_16(TALLOC_CTX *mem_ctx, SAM_USER_INFO_16 *id16, DOM_SID *user_sid)
 {
        SAM_ACCOUNT *smbpass=NULL;
        BOOL ret;
@@ -1437,8 +1437,8 @@ static NTSTATUS get_user_info_10(TALLOC_CTX *mem_ctx, SAM_USER_INFO_10 *id10, DO
 
        DEBUG(3,("User:[%s]\n", pdb_get_username(smbpass) ));
 
-       ZERO_STRUCTP(id10);
-       init_sam_user_info10(id10, pdb_get_acct_ctrl(smbpass) );
+       ZERO_STRUCTP(id16);
+       init_sam_user_info16(id16, pdb_get_acct_ctrl(smbpass) );
 
        pdb_free_sam(&smbpass);
 
@@ -1446,12 +1446,12 @@ static NTSTATUS get_user_info_10(TALLOC_CTX *mem_ctx, SAM_USER_INFO_10 *id10, DO
 }
 
 /*************************************************************************
- get_user_info_12. OK - this is the killer as it gives out password info.
+ get_user_info_18. OK - this is the killer as it gives out password info.
  Ensure that this is only allowed on an encrypted connection with a root
  user. JRA. 
  *************************************************************************/
 
-static NTSTATUS get_user_info_12(pipes_struct *p, TALLOC_CTX *mem_ctx, SAM_USER_INFO_12 * id12, DOM_SID *user_sid)
+static NTSTATUS get_user_info_18(pipes_struct *p, TALLOC_CTX *mem_ctx, SAM_USER_INFO_18 * id18, DOM_SID *user_sid)
 {
        SAM_ACCOUNT *smbpass=NULL;
        BOOL ret;
@@ -1488,8 +1488,8 @@ static NTSTATUS get_user_info_12(pipes_struct *p, TALLOC_CTX *mem_ctx, SAM_USER_
                return NT_STATUS_ACCOUNT_DISABLED;
        }
 
-       ZERO_STRUCTP(id12);
-       init_sam_user_info12(id12, pdb_get_lanman_passwd(smbpass), pdb_get_nt_passwd(smbpass));
+       ZERO_STRUCTP(id18);
+       init_sam_user_info18(id18, pdb_get_lanman_passwd(smbpass), pdb_get_nt_passwd(smbpass));
        
        pdb_free_sam(&smbpass);
 
@@ -1601,7 +1601,7 @@ NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_
        ctr->switch_value = q_u->switch_value;
 
        switch (q_u->switch_value) {
-       case 0x07:
+       case 7:
                ctr->info.id7 = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_7);
                if (ctr->info.id7 == NULL)
                        return NT_STATUS_NO_MEMORY;
@@ -1609,18 +1609,18 @@ NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_
                if (!NT_STATUS_IS_OK(r_u->status = get_user_info_7(p->mem_ctx, ctr->info.id7, &info->sid)))
                        return r_u->status;
                break;
-       case 0x10:
-               ctr->info.id10 = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_10);
-               if (ctr->info.id10 == NULL)
+       case 16:
+               ctr->info.id16 = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_16);
+               if (ctr->info.id16 == NULL)
                        return NT_STATUS_NO_MEMORY;
 
-               if (!NT_STATUS_IS_OK(r_u->status = get_user_info_10(p->mem_ctx, ctr->info.id10, &info->sid)))
+               if (!NT_STATUS_IS_OK(r_u->status = get_user_info_16(p->mem_ctx, ctr->info.id16, &info->sid)))
                        return r_u->status;
                break;
 
 #if 0
 /* whoops - got this wrong.  i think.  or don't understand what's happening. */
-        case 0x11:
+        case 17:
         {
             NTTIME expire;
             info = (void *)&id11;
@@ -1628,9 +1628,9 @@ NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_
             expire.low = 0xffffffff;
             expire.high = 0x7fffffff;
 
-            ctr->info.id = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_11));
-           ZERO_STRUCTP(ctr->info.id11);
-            init_sam_user_info11(ctr->info.id11, &expire,
+            ctr->info.id = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_17));
+           ZERO_STRUCTP(ctr->info.id17);
+            init_sam_user_info17(ctr->info.id17, &expire,
                          "BROOKFIELDS$",    /* name */
                          0x03ef,    /* user rid */
                          0x201, /* group rid */
@@ -1640,12 +1640,12 @@ NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_
         }
 #endif
 
-       case 0x12:
-               ctr->info.id12 = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_12);
-               if (ctr->info.id12 == NULL)
+       case 18:
+               ctr->info.id18 = TALLOC_ZERO_P(p->mem_ctx, SAM_USER_INFO_18);
+               if (ctr->info.id18 == NULL)
                        return NT_STATUS_NO_MEMORY;
 
-               if (!NT_STATUS_IS_OK(r_u->status = get_user_info_12(p, p->mem_ctx, ctr->info.id12, &info->sid)))
+               if (!NT_STATUS_IS_OK(r_u->status = get_user_info_18(p, p->mem_ctx, ctr->info.id18, &info->sid)))
                        return r_u->status;
                break;
                
@@ -2418,19 +2418,19 @@ NTSTATUS _samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN_A
 }
 
 /*******************************************************************
- set_user_info_10
+ set_user_info_16
  ********************************************************************/
 
-static BOOL set_user_info_10(const SAM_USER_INFO_10 *id10, SAM_ACCOUNT *pwd)
+static BOOL set_user_info_16(const SAM_USER_INFO_16 *id16, SAM_ACCOUNT *pwd)
 {
-       if (id10 == NULL) {
-               DEBUG(5, ("set_user_info_10: NULL id10\n"));
+       if (id16 == NULL) {
+               DEBUG(5, ("set_user_info_16: NULL id16\n"));
                pdb_free_sam(&pwd);
                return False;
        }
        
        /* FIX ME: check if the value is really changed --metze */
-       if (!pdb_set_acct_ctrl(pwd, id10->acb_info, PDB_CHANGED)) {
+       if (!pdb_set_acct_ctrl(pwd, id16->acb_info, PDB_CHANGED)) {
                pdb_free_sam(&pwd);
                return False;
        }
@@ -2446,23 +2446,23 @@ static BOOL set_user_info_10(const SAM_USER_INFO_10 *id10, SAM_ACCOUNT *pwd)
 }
 
 /*******************************************************************
- set_user_info_12
+ set_user_info_18
  ********************************************************************/
 
-static BOOL set_user_info_12(SAM_USER_INFO_12 *id12, SAM_ACCOUNT *pwd)
+static BOOL set_user_info_18(SAM_USER_INFO_18 *id18, SAM_ACCOUNT *pwd)
 {
 
-       if (id12 == NULL) {
-               DEBUG(2, ("set_user_info_12: id12 is NULL\n"));
+       if (id18 == NULL) {
+               DEBUG(2, ("set_user_info_18: id18 is NULL\n"));
                pdb_free_sam(&pwd);
                return False;
        }
  
-       if (!pdb_set_lanman_passwd (pwd, id12->lm_pwd, PDB_CHANGED)) {
+       if (!pdb_set_lanman_passwd (pwd, id18->lm_pwd, PDB_CHANGED)) {
                pdb_free_sam(&pwd);
                return False;
        }
-       if (!pdb_set_nt_passwd     (pwd, id12->nt_pwd, PDB_CHANGED)) {
+       if (!pdb_set_nt_passwd     (pwd, id18->nt_pwd, PDB_CHANGED)) {
                pdb_free_sam(&pwd);
                return False;
        }
@@ -2779,7 +2779,7 @@ NTSTATUS _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SE
 
        switch (switch_value) {
                case 18:
-                       if (!set_user_info_12(ctr->info.id12, pwd))
+                       if (!set_user_info_18(ctr->info.id18, pwd))
                                r_u->status = NT_STATUS_ACCESS_DENIED;
                        break;
 
@@ -2919,12 +2919,12 @@ NTSTATUS _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_
        
        switch (switch_value) {
                case 16:
-                       if (!set_user_info_10(ctr->info.id10, pwd))
+                       if (!set_user_info_16(ctr->info.id16, pwd))
                                r_u->status = NT_STATUS_ACCESS_DENIED;
                        break;
                case 18:
                        /* Used by AS/U JRA. */
-                       if (!set_user_info_12(ctr->info.id12, pwd))
+                       if (!set_user_info_18(ctr->info.id18, pwd))
                                r_u->status = NT_STATUS_ACCESS_DENIED;
                        break;
                case 20:
index 6888076a147fda5fbf7f87d8aa596ea3109c7b42..8d19ad888fc4e4ce7a1102f0f2d97edab88bcd7d 100644 (file)
@@ -117,7 +117,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
        uchar pwbuf[516];
        SAM_USERINFO_CTR ctr;
        SAM_USER_INFO_24 p24;
-       SAM_USER_INFO_10 p10;
+       SAM_USER_INFO_16 p16;
        uchar md4_trust_password[16];
 
        /* Misc */
@@ -287,15 +287,15 @@ int net_rpc_join_newstyle(int argc, const char **argv)
           userinfo2 level 0x10 fails.  -tpot */
 
        ZERO_STRUCT(ctr);
-       ctr.switch_value = 0x10;
-       ctr.info.id10 = &p10;
+       ctr.switch_value = 16;
+       ctr.info.id16 = &p16;
 
-       init_sam_user_info10(&p10, acb_info);
+       init_sam_user_info16(&p16, acb_info);
 
        /* Ignoring the return value is necessary for joining a domain
           as a normal user with "Add workstation to domain" privilege. */
 
-       result = cli_samr_set_userinfo2(cli, mem_ctx, &user_pol, 0x10
+       result = cli_samr_set_userinfo2(cli, mem_ctx, &user_pol, 16
                                        &cli->user_session_key, &ctr);
 
        /* Now check the whole process from top-to-bottom */