Skip to content

Commit

Permalink
confdb: Add new option subdomain_inherit
Browse files Browse the repository at this point in the history
Adds a new option subdomain_inherit that would allow administrators to pick
and choose which option to pass to subdomains.

This option is required for:
    https://fedorahosted.org/sssd/ticket/2644
as a short-term fix.

The proper solution is described in:
    https://fedorahosted.org/sssd/ticket/2599

Reviewed-by: Pavel Reichl <preichl@redhat.com>
  • Loading branch information
jhrozek committed Jun 5, 2015
1 parent 3683195 commit 1711cbf
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/confdb/confdb.c
Expand Up @@ -1256,6 +1256,19 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
}
}

tmp = ldb_msg_find_attr_as_string(res->msgs[0],
CONFDB_DOMAIN_SUBDOMAIN_INHERIT,
NULL);
if (tmp != NULL) {
ret = split_on_separator(domain, tmp, ',', true, true,
&domain->sd_inherit, NULL);
if (ret != 0) {
DEBUG(SSSDBG_FATAL_FAILURE,
"Cannot parse %s\n", CONFDB_SUBDOMAIN_ENUMERATE);
goto done;
}
}

ret = get_entry_as_uint32(res->msgs[0], &domain->subdomain_refresh_interval,
CONFDB_DOMAIN_SUBDOMAIN_REFRESH, 14400);
if (ret != EOK || domain->subdomain_refresh_interval == 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/confdb/confdb.h
Expand Up @@ -187,6 +187,7 @@
#define CONFDB_DOMAIN_PWD_EXPIRATION_WARNING "pwd_expiration_warning"
#define CONFDB_DOMAIN_REFRESH_EXPIRED_INTERVAL "refresh_expired_interval"
#define CONFDB_DOMAIN_OFFLINE_TIMEOUT "offline_timeout"
#define CONFDB_DOMAIN_SUBDOMAIN_INHERIT "subdomain_inherit"

/* Local Provider */
#define CONFDB_LOCAL_DEFAULT_SHELL "default_shell"
Expand Down Expand Up @@ -268,6 +269,7 @@ struct sss_domain_info {
struct sss_domain_info *next;

bool disabled;
char **sd_inherit;
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/config/SSSDConfig/__init__.py.in
Expand Up @@ -148,6 +148,7 @@ option_strings = {
'dyndns_auth' : _("What kind of authentication should be used to perform the DNS update"),
'subdomain_enumerate' : _('Control enumeration of trusted domains'),
'subdomain_refresh_interval' : _('How often should subdomains list be refreshed'),
'subdomain_inherit' : _('List of options that should be inherited into a subdomain'),

# [provider/ipa]
'ipa_domain' : _('IPA domain'),
Expand Down
6 changes: 4 additions & 2 deletions src/config/SSSDConfigTest.py
Expand Up @@ -546,7 +546,8 @@ def testListOptions(self):
'hostid_provider',
'subdomains_provider',
'realmd_tags',
'subdomain_refresh_interval']
'subdomain_refresh_interval',
'subdomain_inherit']

self.assertTrue(type(options) == dict,
"Options should be a dictionary")
Expand Down Expand Up @@ -908,7 +909,8 @@ def testRemoveProvider(self):
'hostid_provider',
'subdomains_provider',
'realmd_tags',
'subdomain_refresh_interval']
'subdomain_refresh_interval',
'subdomain_inherit']

self.assertTrue(type(options) == dict,
"Options should be a dictionary")
Expand Down
1 change: 1 addition & 0 deletions src/config/etc/sssd.api.conf
Expand Up @@ -132,6 +132,7 @@ default_shell = str, None, false
description = str, None, false
realmd_tags = str, None, false
subdomain_refresh_interval = int, None, false
subdomain_inherit = str, None, false

#Entry cache timeouts
entry_cache_user_timeout = int, None, false
Expand Down
20 changes: 19 additions & 1 deletion src/man/sssd.conf.5.xml
Expand Up @@ -479,7 +479,25 @@
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>subdomain_inherit (string)</term>
<listitem>
<para>
Specifies a list of configuration parameters that
should be inherited by a subdomain. Please note
that only selected parameters can be inherited.
</para>
<para>
Example:
<programlisting>
subdomain_inherit = ldap_purge_cache_timeout
</programlisting>
</para>
<para>
Default: none
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

Expand Down

0 comments on commit 1711cbf

Please sign in to comment.