diff options
author | Jean-François Micouleau <jfm@samba.org> | 2001-12-02 00:03:35 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2001-12-02 00:03:35 +0000 |
commit | 83304678a06dab22d87086d0b41e245422be7ae8 (patch) | |
tree | 468138501fea016bf7233c6645c2b4938ece1f1f /source3/passdb/nispass.c | |
parent | d383b618b4b2a1007568e961627c5a9bf5a38594 (diff) | |
download | samba-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/nispass.c')
-rw-r--r-- | source3/passdb/nispass.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/passdb/nispass.c b/source3/passdb/nispass.c index 79465982ec..0f41b47549 100644 --- a/source3/passdb/nispass.c +++ b/source3/passdb/nispass.c @@ -302,9 +302,20 @@ static BOOL make_sam_from_nisp_object(struct sam_passwd *pw_buf, nis_object *obj sam_logon_in_ssb = True; get_single_attribute(obj, NPF_GROUP_RID, temp, sizeof(pstring)); - pw_buf->group_rid = (strlen(temp) > 0) ? - strtol(temp, NULL, 16) : pdb_gid_to_group_rid (pw_buf->smb_grpid); + if (strlen(temp) > 0) + pw_buf->group_rid = strtol(temp, NULL, 16); + else { + GROUP_MAP map; + + if (get_group_map_from_gid(pw_buf->smb_grpid, &map)) { + free_privileges(&map.priv_set); + pw_buf->group_rid = map.rid; + } + else + pw_buf->group_rid = pdb_gid_to_group_rid(pw_buf->smb_grpid); + } + get_single_attribute(obj, NPF_FULL_NAME, full_name, sizeof(pstring)); #if 1 /* It seems correct to use the global values - but in that case why |