mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
Moved winbind client functions from various odd locations to
nsswitch/wb_client.c Merge of nsswitch/common.c rename to nsswitch/wb_common.c from TNG.
This commit is contained in:
@ -25,70 +25,6 @@
|
||||
|
||||
extern int DEBUGLEVEL;
|
||||
|
||||
/* Call winbindd to convert uid to sid */
|
||||
|
||||
BOOL winbind_uid_to_sid(uid_t uid, DOM_SID *sid)
|
||||
{
|
||||
struct winbindd_request request;
|
||||
struct winbindd_response response;
|
||||
int result;
|
||||
|
||||
if (!sid) return False;
|
||||
|
||||
/* Initialise request */
|
||||
|
||||
ZERO_STRUCT(request);
|
||||
ZERO_STRUCT(response);
|
||||
|
||||
request.data.uid = uid;
|
||||
|
||||
/* Make request */
|
||||
|
||||
result = winbindd_request(WINBINDD_UID_TO_SID, &request, &response);
|
||||
|
||||
/* Copy out result */
|
||||
|
||||
if (result == NSS_STATUS_SUCCESS) {
|
||||
string_to_sid(sid, response.data.sid.sid);
|
||||
} else {
|
||||
sid_copy(sid, &global_sid_NULL);
|
||||
}
|
||||
|
||||
return (result == NSS_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Call winbindd to convert uid to sid */
|
||||
|
||||
BOOL winbind_gid_to_sid(gid_t gid, DOM_SID *sid)
|
||||
{
|
||||
struct winbindd_request request;
|
||||
struct winbindd_response response;
|
||||
int result;
|
||||
|
||||
if (!sid) return False;
|
||||
|
||||
/* Initialise request */
|
||||
|
||||
ZERO_STRUCT(request);
|
||||
ZERO_STRUCT(response);
|
||||
|
||||
request.data.gid = gid;
|
||||
|
||||
/* Make request */
|
||||
|
||||
result = winbindd_request(WINBINDD_GID_TO_SID, &request, &response);
|
||||
|
||||
/* Copy out result */
|
||||
|
||||
if (result == NSS_STATUS_SUCCESS) {
|
||||
string_to_sid(sid, response.data.sid.sid);
|
||||
} else {
|
||||
sid_copy(sid, &global_sid_NULL);
|
||||
}
|
||||
|
||||
return (result == NSS_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Process an access allowed ACE */
|
||||
|
||||
static BOOL ace_grant(uint32 mask, uint32 *acc_desired, uint32 *acc_granted)
|
||||
|
Reference in New Issue
Block a user