mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
Revert "Make use of sid_check_is_in_unix_users/groups"
This reverts commit cd8e63b2b45402091d6d328b3c6ca593fc19ac92. (This used to be commit 061e55d4f48d269dc45fad6739e0872501b9433d)
This commit is contained in:
parent
68071e94a5
commit
e613ecbea5
@ -1344,6 +1344,7 @@ void gid_to_sid(DOM_SID *psid, gid_t gid)
|
||||
|
||||
bool sid_to_uid(const DOM_SID *psid, uid_t *puid)
|
||||
{
|
||||
uint32 rid;
|
||||
gid_t gid;
|
||||
|
||||
if (fetch_uid_from_cache(puid, psid))
|
||||
@ -1355,16 +1356,13 @@ bool sid_to_uid(const DOM_SID *psid, uid_t *puid)
|
||||
|
||||
/* Optimize for the Unix Users Domain
|
||||
* as the conversion is straightforward */
|
||||
|
||||
if (sid_check_is_in_unix_users(psid)) {
|
||||
uint32_t rid;
|
||||
|
||||
sid_peek_rid(psid, &rid);
|
||||
*puid = (uid_t)rid;
|
||||
if (sid_peek_check_rid(&global_sid_Unix_Users, psid, &rid)) {
|
||||
uid_t uid = rid;
|
||||
*puid = uid;
|
||||
|
||||
/* return here, don't cache */
|
||||
DEBUG(10, ("sid %s -> uid %u\n", sid_string_dbg(psid),
|
||||
(unsigned int)rid));
|
||||
DEBUG(10,("sid %s -> uid %u\n", sid_string_dbg(psid),
|
||||
(unsigned int)*puid ));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1406,16 +1404,13 @@ bool sid_to_gid(const DOM_SID *psid, gid_t *pgid)
|
||||
|
||||
/* Optimize for the Unix Groups Domain
|
||||
* as the conversion is straightforward */
|
||||
|
||||
if (sid_check_is_in_unix_groups(psid)) {
|
||||
uint32_t rid;
|
||||
|
||||
sid_peek_rid(psid, &rid);
|
||||
*pgid = (gid_t)rid;
|
||||
if (sid_peek_check_rid(&global_sid_Unix_Groups, psid, &rid)) {
|
||||
gid_t gid = rid;
|
||||
*pgid = gid;
|
||||
|
||||
/* return here, don't cache */
|
||||
DEBUG(10, ("sid %s -> gid %u\n", sid_string_dbg(psid),
|
||||
(unsigned int)rid));
|
||||
DEBUG(10,("sid %s -> gid %u\n", sid_string_dbg(psid),
|
||||
(unsigned int)*pgid ));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user