mirror of
https://github.com/samba-team/samba.git
synced 2025-05-30 01:05:50 +03:00
wbinfo: use wbcUidToSid()
metze (This used to be commit 4766ebf7ac8d33f9cd0f983ecdc54ef44959648b)
This commit is contained in:
parent
fd8cf63811
commit
aa4033a21e
@ -562,23 +562,27 @@ static bool wbinfo_check_secret(void)
|
|||||||
|
|
||||||
static bool wbinfo_uid_to_sid(uid_t uid)
|
static bool wbinfo_uid_to_sid(uid_t uid)
|
||||||
{
|
{
|
||||||
struct winbindd_request request;
|
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
|
||||||
struct winbindd_response response;
|
struct wbcDomainSid sid;
|
||||||
|
char *sid_str = NULL;
|
||||||
ZERO_STRUCT(request);
|
|
||||||
ZERO_STRUCT(response);
|
|
||||||
|
|
||||||
/* Send request */
|
/* Send request */
|
||||||
|
|
||||||
request.data.uid = uid;
|
wbc_status = wbcUidToSid(uid, &sid);
|
||||||
|
if (!WBC_ERROR_IS_OK(wbc_status)) {
|
||||||
if (winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response) !=
|
|
||||||
NSS_STATUS_SUCCESS)
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
wbc_status = wbcSidToString(&sid, &sid_str);
|
||||||
|
if (!WBC_ERROR_IS_OK(wbc_status)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Display response */
|
/* Display response */
|
||||||
|
|
||||||
d_printf("%s\n", response.data.sid.sid);
|
d_printf("%s\n", sid_str);
|
||||||
|
|
||||||
|
wbcFreeMemory(sid_str);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user