diff options
author | Michael Adam <obnox@samba.org> | 2009-02-02 00:46:57 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-02-02 00:53:05 +0100 |
commit | d75b3913c9e03ff97336aa7a6e1cbac2eb03f230 (patch) | |
tree | 32d8166ba8b1d4f1e951a2c1a8f285ac860bf6a5 | |
parent | a0d05192006c4bade760bd945ab91b5268ca47a6 (diff) | |
download | samba-d75b3913c9e03ff97336aa7a6e1cbac2eb03f230.tar.gz samba-d75b3913c9e03ff97336aa7a6e1cbac2eb03f230.tar.bz2 samba-d75b3913c9e03ff97336aa7a6e1cbac2eb03f230.zip |
s3:winbind_group: fix "getent group" to allocate new gids.
"getent group" used to fill the idmap cache with negative
cache entries for unmapped group sids.
Don't pass domain name unconditionally to idmap_sid_to_gid().
idmap_sid_to_gid() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".
Note that it is _wrong_ to directly call the idmap_sid_to_gid()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_gid request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.
Michael
-rw-r--r-- | source3/winbindd/winbindd_group.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c index bc532bbce7..48e6577902 100644 --- a/source3/winbindd/winbindd_group.c +++ b/source3/winbindd/winbindd_group.c @@ -1306,6 +1306,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state) char *gr_mem; DOM_SID group_sid; struct winbindd_domain *domain; + char *domain_name_idmap; /* Do we need to fetch another chunk of groups? */ @@ -1353,8 +1354,13 @@ void winbindd_getgrent(struct winbindd_cli_state *state) sid_copy(&group_sid, &domain->sid); sid_append_rid(&group_sid, name_list[ent->sam_entry_index].rid); - if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain->name, &group_sid, - &group_gid))) { + domain_name_idmap = domain->have_idmap_config + ? domain->name + : ""; + + if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain_name_idmap, + &group_sid, &group_gid))) + { union unid_t id; enum lsa_SidType type; |