bug fix in lsa_trans_names.
authorLuke Leighton <lkcl@samba.org>
Thu, 22 Oct 1998 18:15:23 +0000 (18:15 +0000)
committerLuke Leighton <lkcl@samba.org>
Thu, 22 Oct 1998 18:15:23 +0000 (18:15 +0000)
well-known aliases S-1-5-20 is actually S-1-5-0x20 but sid_to_string does
decimal not hexadecimal oops.
(This used to be commit 4d830e243650729344a2d1b238075e787802ff8b)

source3/include/proto.h
source3/lsarpcd/srv_lsa.c
source3/rpc_parse/parse_lsa.c
source3/rpc_server/srv_lsa.c
source3/rpc_server/srv_samr.c

index f9c3d8734bbf949aab3ea28861fb73379a6dd528..d75832395d16a43c9e01dd8adffb4354120f3a11 100644 (file)
@@ -1343,7 +1343,8 @@ BOOL do_wks_query_info(struct cli_state *cli,
 
 /*The following definitions come from  rpc_parse/parse_lsa.c  */
 
-void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx);
+void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
+                       uint32 sid_name_use, char *name, uint32 idx);
 void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff,
                                uint32 unknown);
 void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos);
index a355f0b311cd0dea013375bbc32ffae6864f3319..b813301ddac8ce4e9de3d7d6d9da90aae8cd10bd 100644 (file)
@@ -231,7 +231,9 @@ static void make_lsa_trans_names(LSA_TRANS_NAME_ENUM *trn,
 
                if (status == 0x0)
                {
-                       make_lsa_trans_name(&(trn->name[(*total)]), type, name, (*total));
+                       make_lsa_trans_name(&(trn->name    [(*total)]),
+                                           &(trn->uni_name[(*total)]),
+                                           type, name, (*total));
                        (*total)++;
                }
        }
index 49a0951554a110c938a1ae7fcf4b182f0f55c573..cc60ace9fc97d7d9c04ff9e5b3998f7ffbaa49b8 100644 (file)
@@ -31,12 +31,14 @@ static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct
 /*******************************************************************
 creates a LSA_TRANS_NAME structure.
 ********************************************************************/
-void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx)
+void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
+                       uint32 sid_name_use, char *name, uint32 idx)
 {
        int len_name = strlen(name);
 
        trn->sid_name_use = sid_name_use;
        make_uni_hdr(&(trn->hdr_name), len_name, len_name, len_name != 0);
+       make_unistr2(uni_name, name, len_name);
        trn->domain_idx = idx;
 }
 
index a355f0b311cd0dea013375bbc32ffae6864f3319..b813301ddac8ce4e9de3d7d6d9da90aae8cd10bd 100644 (file)
@@ -231,7 +231,9 @@ static void make_lsa_trans_names(LSA_TRANS_NAME_ENUM *trn,
 
                if (status == 0x0)
                {
-                       make_lsa_trans_name(&(trn->name[(*total)]), type, name, (*total));
+                       make_lsa_trans_name(&(trn->name    [(*total)]),
+                                           &(trn->uni_name[(*total)]),
+                                           type, name, (*total));
                        (*total)++;
                }
        }
index e9204e065ffc6fda0ea00e199468e131191d83c0..3a656b5a3b1f8ba41c9cd1df45acf33ff401f6b8 100644 (file)
@@ -306,7 +306,7 @@ static void samr_reply_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
                
                        string_to_sid(&everyone_sid, "S-1-1");
 
-                       /* maybe need another 1 or 2 (S-1-5-20-0x220 and S-1-5-20-0x224) */
+                       /* maybe need another 1 or 2 (S-1-5-0x20-0x220 and S-1-5-20-0x224) */
                        /* these two are DOMAIN_ADMIN and DOMAIN_ACCT_OP group RIDs */
                        make_dom_sid3(&(sid[0]), 0x035b, 0x0002, &everyone_sid);
                        make_dom_sid3(&(sid[1]), 0x0044, 0x0002, &user_sid);
@@ -456,7 +456,7 @@ static void samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
 {
        SAMR_R_ENUM_DOM_ALIASES r_e;
        SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES];
-       int num_entries;
+       int num_entries = 0;
        DOM_SID sid;
        fstring sid_str;
        fstring sam_sid_str;
@@ -476,7 +476,7 @@ static void samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
        DEBUG(5,("samr_reply_enum_dom_aliases: sid %s\n", sid_str));
 
        /* well-known aliases */
-       if (strequal(sid_str, "S-1-5-20"))
+       if (strequal(sid_str, "S-1-5-32"))
        {
                char *name;
                while (num_entries < MAX_SAM_ENTRIES && ((name = builtin_alias_rids[num_entries].name) != NULL))