From 3dc1545b247f55128de7e89193221be9bf1f10d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 28 Mar 2008 19:37:50 +0100 Subject: wbinfo: use wbcSidToUid() metze (This used to be commit a25b39cac1716323154dd30acb30180d3273587b) --- source3/nsswitch/wbinfo.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index c99e288e07..ecceb92928 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -618,25 +618,27 @@ static bool wbinfo_gid_to_sid(gid_t gid) /* Convert sid to uid */ -static bool wbinfo_sid_to_uid(char *sid) +static bool wbinfo_sid_to_uid(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; + uid_t uid; /* 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_UID, &request, &response) != - NSS_STATUS_SUCCESS) + wbc_status = wbcSidToUid(&sid, &uid); + if (!WBC_ERROR_IS_OK(wbc_status)) { return false; + } /* Display response */ - d_printf("%d\n", (int)response.data.uid); + d_printf("%d\n", (int)uid); return true; } -- cgit