summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_nisplus.c
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-12-02 00:03:35 +0000
committerJean-François Micouleau <jfm@samba.org>2001-12-02 00:03:35 +0000
commit83304678a06dab22d87086d0b41e245422be7ae8 (patch)
tree468138501fea016bf7233c6645c2b4938ece1f1f /source3/passdb/pdb_nisplus.c
parentd383b618b4b2a1007568e961627c5a9bf5a38594 (diff)
downloadsamba-83304678a06dab22d87086d0b41e245422be7ae8.tar.gz
samba-83304678a06dab22d87086d0b41e245422be7ae8.tar.bz2
samba-83304678a06dab22d87086d0b41e245422be7ae8.zip
added mapping of primary gid to rid thru the group mapping code.
and cleanup and comments in passdb/passdb.c J.F. (This used to be commit 6533339887832ca6dd42d99385c615db7bee3d43)
Diffstat (limited to 'source3/passdb/pdb_nisplus.c')
-rw-r--r--source3/passdb/pdb_nisplus.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c
index 6a97bd02b8..aff0870a8d 100644
--- a/source3/passdb/pdb_nisplus.c
+++ b/source3/passdb/pdb_nisplus.c
@@ -493,9 +493,24 @@ static BOOL init_nisp_from_sam(nis_object *obj, const SAM_ACCOUNT *sampass,
pdb_get_user_rid(sampass)? pdb_get_user_rid(sampass):
pdb_uid_to_user_rid(pdb_get_uid(sampass)));
slprintf(gid, sizeof(gid)-1, "%u", pdb_get_gid(sampass));
- slprintf(group_rid, sizeof(group_rid)-1, "%u",
- pdb_get_group_rid(sampass)? pdb_get_group_rid(sampass):
- pdb_gid_to_group_rid(pdb_get_gid(sampass)));
+
+ {
+ uint32 rid;
+ GROUP_MAP map;
+
+ rid=pdb_get_group_rid(sampass);
+
+ if (rid==0) {
+ if (get_group_map_from_gid(pdb_get_gid(sampass), &map)) {
+ free_privilege(&map.priv_set);
+ sid_peek_rid(&map.sid, &rid);
+ } else
+ rid=pdb_gid_to_group_rid(pdb_get_gid(sampass));
+ }
+
+ slprintf(group_rid, sizeof(group_rid)-1, "%u", rid);
+ }
+
acb = pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sampass),
NEW_PW_FORMAT_SPACE_PADDED_LEN);
pdb_sethexpwd (smb_passwd, pdb_get_lanman_passwd(sampass),