winbind: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Tue, 11 Dec 2018 10:03:02 +0000 (11:03 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 Dec 2018 22:40:24 +0000 (23:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/winbindd/idmap_rfc2307.c
source3/winbindd/wb_sids2xids.c
source3/winbindd/winbindd_lookupname.c

index f30baf9e1045ec074a0cdcb38ab1157e1d96ae1d..e3bf58d816585e58a8441455a29ad8d8a624f1e3 100644 (file)
@@ -30,6 +30,7 @@
 #include "smbldap.h"
 #include "nsswitch/winbind_client.h"
 #include "lib/winbind_util.h"
+#include "libcli/security/dom_sid.h"
 
 /*
  * Config and connection info per domain.
@@ -454,6 +455,7 @@ static NTSTATUS idmap_rfc_2307_sids_to_names(TALLOC_CTX *mem_ctx,
                enum lsa_SidType lsa_type;
                struct id_map *id = ids[i];
                struct idmap_rfc2307_map *map = &maps[i];
+               struct dom_sid_buf buf;
                bool b;
 
                /* by default calls to winbindd are disabled
@@ -465,7 +467,7 @@ static NTSTATUS idmap_rfc_2307_sids_to_names(TALLOC_CTX *mem_ctx,
 
                if (!b) {
                        DEBUG(1, ("Lookup sid %s failed.\n",
-                                 sid_string_dbg(ids[i]->sid)));
+                                 dom_sid_str_buf(ids[i]->sid, &buf)));
                        continue;
                }
 
@@ -491,7 +493,8 @@ static NTSTATUS idmap_rfc_2307_sids_to_names(TALLOC_CTX *mem_ctx,
 
                default:
                        DEBUG(1, ("Unknown lsa type %d for sid %s\n",
-                                 lsa_type, sid_string_dbg(id->sid)));
+                                 lsa_type,
+                                 dom_sid_str_buf(id->sid, &buf)));
                        id->status = ID_UNMAPPED;
                        continue;
                }
index c687f7064bb6f73247711bd93260782d609e3bb9..7ab8dd133fd817bf12133f5db4a926f6e342374d 100644 (file)
@@ -108,9 +108,10 @@ struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
         * the same index.
         */
        for (i=0; i<state->num_sids; i++) {
+               struct dom_sid_buf buf;
 
                DEBUG(10, ("SID %d: %s\n", (int)i,
-                          sid_string_dbg(&state->sids[i])));
+                          dom_sid_str_buf(&state->sids[i], &buf)));
 
                if (wb_sids2xids_in_cache(&state->sids[i], &state->cached[i])) {
                        continue;
index c5a7c135973952bc8b53ccabce5b48fe9448d771..d6403b32c46cc8277427d40689a9cddae8d92511 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "libcli/security/dom_sid.h"
 
 struct winbindd_lookupname_state {
        struct tevent_context *ev;
@@ -112,8 +113,10 @@ NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
+               struct dom_sid_buf buf;
                DEBUG(5, ("Could not convert sid %s: %s\n",
-                         sid_string_dbg(&state->sid), nt_errstr(status)));
+                         dom_sid_str_buf(&state->sid, &buf),
+                         nt_errstr(status)));
                return status;
        }
        sid_to_fstring(response->data.sid.sid, &state->sid);