summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2016-08-16 13:32:06 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2016-08-17 17:12:35 +0200
commitd9065da2a103fe88b548904bb215c9bb1f21afa2 (patch)
treea818cb84583d3c1c17643bc763ef6a93db9e611e /src/providers/ldap
parent733100a12138a701d0ae7ef5af2b04b08e225033 (diff)
downloadsssd-d9065da2a103fe88b548904bb215c9bb1f21afa2.tar.gz
sssd-d9065da2a103fe88b548904bb215c9bb1f21afa2.tar.xz
sssd-d9065da2a103fe88b548904bb215c9bb1f21afa2.zip
LDAP: Log autofs rfc2307 config changes only with enabled responder
grep -nE "0x0040" /var/log/sssd/sssd_example.com.log 361:(Tue Aug 16 13:04:04 2016) [sssd[be[example.com]]] [ldap_get_autofs_options] (0x0040): Your configuration uses the autofs provider with schema set to rfc2307 and default attribute mappings. The default map has changed in this release, please make sure the configuration matches the server attributes. Reviewed-by: Petr Čech <pcech@redhat.com>
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/ldap_options.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/providers/ldap/ldap_options.c b/src/providers/ldap/ldap_options.c
index 018f6c31f..15a2609f0 100644
--- a/src/providers/ldap/ldap_options.c
+++ b/src/providers/ldap/ldap_options.c
@@ -444,6 +444,10 @@ static bool has_defaults(struct confdb_ctx *cdb,
static bool ldap_rfc2307_autofs_defaults(struct confdb_ctx *cdb,
const char *conf_path)
{
+ char **services = NULL;
+ errno_t ret;
+ bool has_autofs_defaults = false;
+
const char *attrs[] = {
rfc2307_autofs_entry_map[SDAP_OC_AUTOFS_ENTRY].opt_name,
/* SDAP_AT_AUTOFS_ENTRY_KEY missing on purpose, its value was
@@ -455,7 +459,24 @@ static bool ldap_rfc2307_autofs_defaults(struct confdb_ctx *cdb,
NULL,
};
- return has_defaults(cdb, conf_path, attrs);
+ ret = confdb_get_string_as_list(cdb, cdb,
+ CONFDB_MONITOR_CONF_ENTRY,
+ CONFDB_MONITOR_ACTIVE_SERVICES, &services);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_FATAL_FAILURE, "Unable to read from confdb [%d]: %s\n",
+ ret, sss_strerror(ret));
+ goto done;
+ }
+
+ if (string_in_list("autofs", services, true) == false) {
+ goto done;
+ }
+
+ has_autofs_defaults = has_defaults(cdb, conf_path, attrs);
+done:
+ talloc_free(services);
+
+ return has_autofs_defaults;
}
int ldap_get_autofs_options(TALLOC_CTX *memctx,