From aa4033a21e47f906c1de28347d908e44ff951e1c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 28 Mar 2008 19:34:10 +0100 Subject: wbinfo: use wbcUidToSid() metze (This used to be commit 4766ebf7ac8d33f9cd0f983ecdc54ef44959648b) --- source3/nsswitch/wbinfo.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index 7a68b3c838..126c8be401 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -562,23 +562,27 @@ static bool wbinfo_check_secret(void) static bool wbinfo_uid_to_sid(uid_t uid) { - 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 *sid_str = NULL; /* Send request */ - request.data.uid = uid; + wbc_status = wbcUidToSid(uid, &sid); + if (!WBC_ERROR_IS_OK(wbc_status)) { + return false; + } - if (winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response) != - NSS_STATUS_SUCCESS) + wbc_status = wbcSidToString(&sid, &sid_str); + if (!WBC_ERROR_IS_OK(wbc_status)) { return false; + } /* Display response */ - d_printf("%s\n", response.data.sid.sid); + d_printf("%s\n", sid_str); + + wbcFreeMemory(sid_str); return true; } -- cgit