diff options
author | Simo Sorce <idra@samba.org> | 2003-04-29 22:06:16 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-04-29 22:06:16 +0000 |
commit | a1eaa7d5e0f428359c0f661aeb2c313fa428ee0b (patch) | |
tree | 1d006dc489a2373fc3e55f78cc6ce34a4880b9aa /source3/sam/idmap_util.c | |
parent | 0db7c13f9210c0eac82050a2b9e37bd81bfffe10 (diff) | |
download | samba-a1eaa7d5e0f428359c0f661aeb2c313fa428ee0b.tar.gz samba-a1eaa7d5e0f428359c0f661aeb2c313fa428ee0b.tar.bz2 samba-a1eaa7d5e0f428359c0f661aeb2c313fa428ee0b.zip |
This is a nice rewrite:
SAM_ACCOUNT does not have anymore uid and gid fields
all the code that used them has been fixed to use the proper idmap calls
fix to idmap_tdb for first time idmap.tdb initialization.
auth_serversupplied_info structure has now an uid and gid field
few other fixes to make the system behave correctly with idmap
tested only with tdbsam, but smbpasswd and nisplus should be ok
have not tested ldap !
(This used to be commit 6a6f6032467e55aa9b76390e035623976477ba42)
Diffstat (limited to 'source3/sam/idmap_util.c')
-rw-r--r-- | source3/sam/idmap_util.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source3/sam/idmap_util.c b/source3/sam/idmap_util.c index fd44938989..b282d2ef83 100644 --- a/source3/sam/idmap_util.c +++ b/source3/sam/idmap_util.c @@ -97,15 +97,13 @@ DOM_SID *gid_to_sid(DOM_SID *psid, gid_t gid) was done correctly, False if not. sidtype is set by this function. *****************************************************************/ -BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype) +BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid) { unid_t id; int type; DEBUG(10,("sid_to_uid: sid = [%s]\n", sid_string_static(psid))); - *sidtype = SID_NAME_USER; - type = ID_USERID; if (NT_STATUS_IS_OK(idmap_get_id_from_sid(&id, &type, psid))) { DEBUG(10,("sid_to_uid: uid = [%d]\n", id.uid)); @@ -123,7 +121,7 @@ BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype) DEBUG(0, ("sid_to_uid: Error extracting RID from SID\n!")); return False; } - if (!pdb_rid_is_user(rid)) { + if (!fallback_pdb_rid_is_user(rid)) { DEBUG(3, ("sid_to_uid: RID %u is *NOT* a user\n", (unsigned)rid)); return False; } @@ -140,15 +138,13 @@ BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype) was done correctly, False if not. *****************************************************************/ -BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid, enum SID_NAME_USE *sidtype) +BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid) { unid_t id; int type; DEBUG(10,("sid_to_gid: sid = [%s]\n", sid_string_static(psid))); - *sidtype = SID_NAME_ALIAS; - type = ID_GROUPID; if (NT_STATUS_IS_OK(idmap_get_id_from_sid(&id, &type, psid))) { DEBUG(10,("sid_to_gid: gid = [%d]\n", id.gid)); @@ -166,7 +162,6 @@ BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid, enum SID_NAME_USE *sidtype) return False; *pgid = map.gid; - *sidtype = map.sid_name_use; return True; } else { uint32 rid; @@ -175,12 +170,11 @@ BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid, enum SID_NAME_USE *sidtype) DEBUG(0, ("sid_to_gid: Error extracting RID from SID\n!")); return False; } - if (pdb_rid_is_user(rid)) { + if (fallback_pdb_rid_is_user(rid)) { DEBUG(3, ("sid_to_gid: RID %u is *NOT* a group\n", (unsigned)rid)); return False; } *pgid = pdb_group_rid_to_gid(rid); - *sidtype = SID_NAME_ALIAS; } } |