Skip to content

Commit

Permalink
Netgroups should ignore the 'use_fully_qualified_names' setting
Browse files Browse the repository at this point in the history
Netgroups often have memberNisNetgroup entries included in them
that will never process correctly if we require fully-qualified
names on the nested lookup. This patch alters the behavior of
netgroup lookups to check *all* domains for an unqualified
netgroup name, instead of only the ones not requiring fully-
qualified names.

https://fedorahosted.org/sssd/ticket/2013
  • Loading branch information
sgallagher authored and jhrozek committed Jul 29, 2013
1 parent ff7ea28 commit 6266b15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/man/sssd.conf.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,13 @@ override_homedir = /home/%u
wouldn't find the user while <command>getent
passwd test@LOCAL</command> would.
</para>
<para>
NOTE: This option has no effect on netgroup
lookups due to their tendency to include nested
netgroups without qualified names. For netgroups,
all domains will be searched when an unqualified
name is requested.
</para>
<para>
Default: FALSE
</para>
Expand Down
14 changes: 6 additions & 8 deletions src/responder/nss/nsssrv_netgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,12 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)

/* Check each domain for this netgroup name */
while (dom) {
/* if it is a domainless search, skip domains that require fully
* qualified names instead */
while (dom && step_ctx->check_next && dom->fqnames) {
dom = get_next_domain(dom, false);
}

/* No domains left to search */
if (!dom) break;
/* Netgroups are a special case. We have to ignore the
* fully-qualified name requirement because memberNisNetgroup
* entries do not have fully-qualified components and we need
* to be able to always check them. So unlike the other
* maps, here we avoid skipping over fully-qualified domains.
*/

if (dom != step_ctx->dctx->domain) {
/* make sure we reset the check_provider flag when we check
Expand Down

0 comments on commit 6266b15

Please sign in to comment.