lib: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Thu, 13 Dec 2018 20:22:27 +0000 (21:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 Dec 2018 22:40:25 +0000 (23:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/lib/privileges.c
source3/lib/util_sid.c
source3/lib/util_wellknown.c
source3/lib/winbind_util.c

index c02d4c9884cbf0fdf5ff46c2635b5d1604ad9237..19412133342512b578c2fc4d559e9dfb433e1e8e 100644 (file)
@@ -168,13 +168,16 @@ bool get_privileges_for_sids(uint64_t *privileges, struct dom_sid *slist, int sc
        *privileges = 0;
 
        for ( i=0; i<scount; i++ ) {
+               struct dom_sid_buf buf;
+
                /* don't add unless we actually have a privilege assigned */
 
                if ( !get_privileges( &slist[i], &mask ) )
                        continue;
 
                DEBUG(5,("get_privileges_for_sids: sid = %s\nPrivilege "
-                        "set: 0x%llx\n", sid_string_dbg(&slist[i]),
+                        "set: 0x%llx\n",
+                        dom_sid_str_buf(&slist[i], &buf),
                         (unsigned long long)mask));
 
                *privileges |= mask;
@@ -341,6 +344,7 @@ NTSTATUS privilege_enum_sids(enum sec_privilege privilege, TALLOC_CTX *mem_ctx,
 static bool grant_privilege_bitmap(const struct dom_sid *sid, const uint64_t priv_mask)
 {
        uint64_t old_mask, new_mask;
+       struct dom_sid_buf buf;
 
        ZERO_STRUCT( old_mask );
        ZERO_STRUCT( new_mask );
@@ -352,7 +356,7 @@ static bool grant_privilege_bitmap(const struct dom_sid *sid, const uint64_t pri
 
        new_mask |= priv_mask;
 
-       DEBUG(10,("grant_privilege: %s\n", sid_string_dbg(sid)));
+       DEBUG(10,("grant_privilege: %s\n", dom_sid_str_buf(sid, &buf)));
 
        DEBUGADD( 10, ("original privilege mask: 0x%llx\n", (unsigned long long)new_mask));
 
@@ -398,13 +402,14 @@ bool grant_privilege_set(const struct dom_sid *sid, struct lsa_PrivilegeSet *set
 static bool revoke_privilege_bitmap(const struct dom_sid *sid, const uint64_t priv_mask)
 {
        uint64_t mask;
+       struct dom_sid_buf buf;
 
        /* if the user has no privileges, then we can't revoke any */
 
        if ( !get_privileges( sid, &mask ) )
                return True;
 
-       DEBUG(10,("revoke_privilege: %s\n", sid_string_dbg(sid)));
+       DEBUG(10,("revoke_privilege: %s\n", dom_sid_str_buf(sid, &buf)));
 
        DEBUGADD( 10, ("original privilege mask: 0x%llx\n", (unsigned long long)mask));
 
index 0e79a6ef2f05c1f170edcc8555f5135287838831..71a4800d60216ced68c5d356f7c06e4f09464fa2 100644 (file)
@@ -175,8 +175,9 @@ NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
                status = add_sid_to_array(mem_ctx, info3->sids[i].sid,
                                      &sid_array, &num_sids);
                if (!NT_STATUS_IS_OK(status)) {
+                       struct dom_sid_buf buf;
                        DEBUG(3, ("could not add SID to array: %s\n",
-                                 sid_string_dbg(info3->sids[i].sid)));
+                                 dom_sid_str_buf(info3->sids[i].sid, &buf)));
                        return status;
                }
        }
index a3db9ab5b445b5026e4a45ada35b1375eec717ca..8cb7a36ddec515d4cd72e8d049b68a8c94ad363c 100644 (file)
@@ -116,6 +116,7 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
        struct dom_sid dom_sid;
        uint32_t rid;
        const struct rid_name_map *users = NULL;
+       struct dom_sid_buf buf;
 
        sid_copy(&dom_sid, sid);
        if (!sid_split_rid(&dom_sid, &rid)) {
@@ -133,7 +134,8 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
        }
 
        if (users == NULL) {
-               DEBUG(10, ("SID %s is no special sid\n", sid_string_dbg(sid)));
+               DEBUG(10, ("SID %s is no special sid\n",
+                          dom_sid_str_buf(sid, &buf)));
                return False;
        }
 
@@ -144,7 +146,8 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
                }
        }
 
-       DEBUG(10, ("RID of special SID %s not found\n", sid_string_dbg(sid)));
+       DEBUG(10, ("RID of special SID %s not found\n",
+                  dom_sid_str_buf(sid, &buf)));
 
        return False;
 }
index 427831f04c83b3b9020b39fb43012fa7d211bb1f..a072166ce1899c693212d9140ddec61051ab3e91 100644 (file)
@@ -94,6 +94,7 @@ bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
        enum wbcSidType type;
        char *domain_name = NULL;
        char *account_name = NULL;
+       struct dom_sid_buf buf;
 
        memcpy(&dom_sid, sid, sizeof(dom_sid));
 
@@ -112,7 +113,7 @@ bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
        *name_type = (enum lsa_SidType)type;
 
        DEBUG(10, ("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n",
-                  sid_string_dbg(sid), domain_name, account_name));
+                  dom_sid_str_buf(sid, &buf), domain_name, account_name));
 
        wbcFreeMemory(domain_name);
        wbcFreeMemory(account_name);