diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-04-02 05:26:36 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-04-03 15:49:18 +0200 |
commit | 421f9d2e6b36fa2aa54275018375085db4ca7e13 (patch) | |
tree | 9990a5dd50a819560ee795acece56e74c8b647d5 /source3/nsswitch | |
parent | e8ca249d3f2997bb9b75588f794161e74597595a (diff) | |
download | samba-421f9d2e6b36fa2aa54275018375085db4ca7e13.tar.gz samba-421f9d2e6b36fa2aa54275018375085db4ca7e13.tar.bz2 samba-421f9d2e6b36fa2aa54275018375085db4ca7e13.zip |
wbinfo: use wbcLookupSid()
metze
(This used to be commit b917be4986bd55aeffae03b08cf476ea6302fa26)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/wbinfo.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index 66ffa8126d..aac9f3fcb9 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -773,27 +773,30 @@ static bool wbinfo_allocate_gid(void) /* Convert sid to string */ -static bool wbinfo_lookupsid(char *sid) +static bool wbinfo_lookupsid(const char *sid_str) { - struct winbindd_request request; - struct winbindd_response response; - - ZERO_STRUCT(request); - ZERO_STRUCT(response); + wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; + struct wbcDomainSid sid; + char *domain; + char *name; + enum wbcSidType type; /* Send off request */ - fstrcpy(request.data.sid, sid); + wbc_status = wbcStringToSid(sid_str, &sid); + if (!WBC_ERROR_IS_OK(wbc_status)) { + return false; + } - if (winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response) != - NSS_STATUS_SUCCESS) + wbc_status = wbcLookupSid(&sid, &domain, &name, &type); + if (!WBC_ERROR_IS_OK(wbc_status)) { return false; + } /* Display response */ - d_printf("%s%c%s %d\n", response.data.name.dom_name, - winbind_separator(), response.data.name.name, - response.data.name.type); + d_printf("%s%c%s %d\n", + domain, winbind_separator(), name, type); return true; } |