diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-03-28 19:38:24 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-03-31 12:17:36 +0200 |
commit | 9f110a735330a743ad56486034de7c6441a94484 (patch) | |
tree | 87ba342f3be6861ccd907655ecf7738a9f912270 /source3 | |
parent | 3dc1545b247f55128de7e89193221be9bf1f10d7 (diff) | |
download | samba-9f110a735330a743ad56486034de7c6441a94484.tar.gz samba-9f110a735330a743ad56486034de7c6441a94484.tar.bz2 samba-9f110a735330a743ad56486034de7c6441a94484.zip |
wbinfo: use wbcSidToGid()
metze
(This used to be commit 43df48bdca1a71fa44b24bb3917869f886555d9c)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nsswitch/wbinfo.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index ecceb92928..261d9bd2b8 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -643,25 +643,27 @@ static bool wbinfo_sid_to_uid(const char *sid_str) return true; } -static bool wbinfo_sid_to_gid(char *sid) +static bool wbinfo_sid_to_gid(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; + gid_t gid; /* Send 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_SID_TO_GID, &request, &response) != - NSS_STATUS_SUCCESS) + wbc_status = wbcSidToGid(&sid, &gid); + if (!WBC_ERROR_IS_OK(wbc_status)) { return false; + } /* Display response */ - d_printf("%d\n", (int)response.data.gid); + d_printf("%d\n", (int)gid); return true; } |