summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-28 19:37:50 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-31 12:17:36 +0200
commit3dc1545b247f55128de7e89193221be9bf1f10d7 (patch)
treeb34432b0a724f95dc09de86a5b5b2941f6accd93 /source3/nsswitch
parentd3a6368cfd4b890843420eb38ca6c1718e18db6f (diff)
downloadsamba-3dc1545b247f55128de7e89193221be9bf1f10d7.tar.gz
samba-3dc1545b247f55128de7e89193221be9bf1f10d7.tar.bz2
samba-3dc1545b247f55128de7e89193221be9bf1f10d7.zip
wbinfo: use wbcSidToUid()
metze (This used to be commit a25b39cac1716323154dd30acb30180d3273587b)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c22
1 files changed, 12 insertions, 10 deletions
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;
}