]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wbinfo: use wbcLookupSid()
authorStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2008 03:26:36 +0000 (05:26 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 3 Apr 2008 13:49:18 +0000 (15:49 +0200)
metze

source/nsswitch/wbinfo.c

index 66ffa8126d0c8fcecfdd2bfef50f8fddf6a3a551..aac9f3fcb903a3f722b28c3c099abf90a67074ce 100644 (file)
@@ -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;
 }