summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-28 19:37:02 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-31 12:17:35 +0200
commitd3a6368cfd4b890843420eb38ca6c1718e18db6f (patch)
treefa614a64de76ff6f1332812f51421a12c49b10b6 /source3
parentaa4033a21e47f906c1de28347d908e44ff951e1c (diff)
downloadsamba-d3a6368cfd4b890843420eb38ca6c1718e18db6f.tar.gz
samba-d3a6368cfd4b890843420eb38ca6c1718e18db6f.tar.bz2
samba-d3a6368cfd4b890843420eb38ca6c1718e18db6f.zip
wbinfo: use wbcGitToSid()
metze (This used to be commit 9936d861a1c1163ce6fd079211b50fd9b52bc05d)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/wbinfo.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 126c8be401..c99e288e07 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -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;
}