]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wbinfo: use wbcGitToSid()
authorStefan Metzmacher <metze@samba.org>
Fri, 28 Mar 2008 18:37:02 +0000 (19:37 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 31 Mar 2008 10:17:35 +0000 (12:17 +0200)
metze

source/nsswitch/wbinfo.c

index 126c8be4010ed1bfe54490e4034978e9f5bd8321..c99e288e07b352f6c1e02277f4b22c5c1f8632c6 100644 (file)
@@ -591,23 +591,27 @@ static bool wbinfo_uid_to_sid(uid_t uid)
 
 static bool wbinfo_gid_to_sid(gid_t gid)
 {
-       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.gid = gid;
+       wbc_status = wbcGidToSid(gid, &sid);
+       if (!WBC_ERROR_IS_OK(wbc_status)) {
+               return false;
+       }
 
-       if (winbindd_request_response(WINBINDD_GID_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;
 }