Updates to the 'name -> sid' code:
authorAndrew Bartlett <abartlet@samba.org>
Sun, 7 Jul 2002 03:34:24 +0000 (03:34 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 7 Jul 2002 03:34:24 +0000 (03:34 +0000)
Correct the 'none mapped' behaviour, (so that it matches Win2k) and  add a
function to make the SID types appear as text strings in logs/rpcclient.

Also, remove a silly case that would cause 'failure' to be 'success'.  (Might
look at this a bit more in future).

Andrew Bartlett
(This used to be commit c20d057f8821d13d3de61b319de44db23773516b)

source3/rpc_server/srv_lsa_nt.c
source3/rpcclient/cmd_lsarpc.c
source3/smbd/uid.c

index f2f91d2d9a0d82d392e394ea43a9d2da4fb680fe..d072061a5f63effe8622a05b7baa86a4c6673080 100644 (file)
@@ -167,7 +167,7 @@ static void init_lsa_rid2s(DOM_R_REF *ref, DOM_RID2 *rid2,
                DEBUG(5, ("init_lsa_rid2s: %s\n", status ? "found" : 
                          "not found"));
 
-               if (status) {
+               if (status && name_type != SID_NAME_UNKNOWN) {
                        sid_split_rid(&sid, &rid);
                        dom_idx = init_dom_ref(ref, dom_name, &sid);
                        (*mapped_count)++;
index 511f5643c73572e7178c3a9de6ded439be21eb8b..067325c06e66e1c5dcacb449777fac908d3a1b5d 100644 (file)
@@ -106,10 +106,9 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
 
        for (i = 0; i < (argc - 1); i++) {
                fstring sid_str;
-
                sid_to_string(sid_str, &sids[i]);
-               printf("%s %s (%d)\n", argv[i + 1], sid_str,
-                      types[i]);
+               printf("%s %s (%s: %d)\n", argv[i + 1], sid_str,
+                      sid_type_lookup(types[i]), types[i]);
        }
 
  done:
index cb4a975881b2197fc030e59c11ec3040b750bb86..a18f62c9cc861e7d0ccb6088ec077b547f6a84ee 100644 (file)
@@ -465,11 +465,11 @@ BOOL lookup_name(const char *domain, const char *name, DOM_SID *psid, enum SID_N
        
        if (ret) {
                DEBUG(10,
-                     ("lookup_name: (local) [%s]\\[%s] -> SID %s (type %u)\n",
+                     ("lookup_name: (local) [%s]\\[%s] -> SID %s (type %s: %u)\n",
                       domain, name, sid_to_string(sid,psid),
-                      (unsigned int)*name_type ));
+                      sid_type_lookup(*name_type), (unsigned int)*name_type));
                return True;
-       } else if (winbind_lookup_name(domain, name, psid, name_type) || (*name_type != SID_NAME_USER) ) {
+       } else if (winbind_lookup_name(domain, name, psid, name_type)) {
                
                DEBUG(10,("lookup_name (winbindd): [%s]\\[%s] -> SID %s (type %u)\n",
                          domain, name, sid_to_string(sid, psid),