summaryrefslogtreecommitdiffstats
path: root/src/confdb/confdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/confdb/confdb.c')
-rw-r--r--src/confdb/confdb.c146
1 files changed, 73 insertions, 73 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index f0b8bf3d4..57e373035 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -210,8 +210,8 @@ int confdb_add_param(struct confdb_ctx *cdb,
done:
talloc_free(tmp_ctx);
if (ret != EOK) {
- DEBUG(1, ("Failed to add [%s] to [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to add [%s] to [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
}
return ret;
}
@@ -286,8 +286,8 @@ int confdb_get_param(struct confdb_ctx *cdb,
done:
talloc_free(tmp_ctx);
if (ret != EOK) {
- DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to get [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
}
return ret;
}
@@ -329,7 +329,7 @@ int confdb_set_bool(struct confdb_ctx *cdb,
lret = ldb_msg_add_empty(msg, attribute, LDB_FLAG_MOD_REPLACE, NULL);
if (lret != LDB_SUCCESS) {
DEBUG(SSSDBG_MINOR_FAILURE,
- ("ldb_msg_add_empty failed: [%s]\n", ldb_strerror(lret)));
+ "ldb_msg_add_empty failed: [%s]\n", ldb_strerror(lret));
ret = EIO;
goto done;
}
@@ -341,7 +341,7 @@ int confdb_set_bool(struct confdb_ctx *cdb,
}
if (lret != LDB_SUCCESS) {
DEBUG(SSSDBG_MINOR_FAILURE,
- ("ldb_msg_add_string failed: [%s]\n", ldb_strerror(lret)));
+ "ldb_msg_add_string failed: [%s]\n", ldb_strerror(lret));
ret = EIO;
goto done;
}
@@ -350,7 +350,7 @@ int confdb_set_bool(struct confdb_ctx *cdb,
lret = ldb_modify(cdb->ldb, msg);
if (lret != LDB_SUCCESS) {
DEBUG(SSSDBG_MINOR_FAILURE,
- ("ldb_modify failed: [%s]\n", ldb_strerror(lret)));
+ "ldb_modify failed: [%s]\n", ldb_strerror(lret));
ret = EIO;
goto done;
}
@@ -361,8 +361,8 @@ done:
talloc_free(tmp_ctx);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("Failed to set [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ "Failed to set [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
}
return ret;
}
@@ -411,8 +411,8 @@ int confdb_get_string(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
failed:
talloc_free(values);
- DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to get [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
return ret;
}
@@ -466,8 +466,8 @@ int confdb_get_int(struct confdb_ctx *cdb,
failed:
talloc_free(tmp_ctx);
- DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
return ret;
}
@@ -516,8 +516,8 @@ long confdb_get_long(struct confdb_ctx *cdb,
failed:
talloc_free(tmp_ctx);
- DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
return ret;
}
@@ -556,7 +556,7 @@ int confdb_get_bool(struct confdb_ctx *cdb,
} else {
- DEBUG(2, ("Value is not a boolean!\n"));
+ DEBUG(2, "Value is not a boolean!\n");
ret = EINVAL;
goto failed;
}
@@ -572,8 +572,8 @@ int confdb_get_bool(struct confdb_ctx *cdb,
failed:
talloc_free(tmp_ctx);
- DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
return ret;
}
@@ -608,8 +608,8 @@ int confdb_get_string_as_list(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
done:
talloc_free(values);
if (ret != EOK && ret != ENOENT) {
- DEBUG(2, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
- attribute, section, ret, strerror(ret)));
+ DEBUG(2, "Failed to get [%s] from [%s], error [%d] (%s)\n",
+ attribute, section, ret, strerror(ret));
}
return ret;
}
@@ -647,7 +647,7 @@ int confdb_init(TALLOC_CTX *mem_ctx,
ret = ldb_set_debug(cdb->ldb, ldb_debug_messages, NULL);
if (ret != LDB_SUCCESS) {
- DEBUG(0,("Could not set up debug fn.\n"));
+ DEBUG(0,"Could not set up debug fn.\n");
talloc_free(cdb);
return EIO;
}
@@ -657,8 +657,8 @@ int confdb_init(TALLOC_CTX *mem_ctx,
ret = ldb_connect(cdb->ldb, confdb_location, 0, NULL);
umask(old_umask);
if (ret != LDB_SUCCESS) {
- DEBUG(0, ("Unable to open config database [%s]\n",
- confdb_location));
+ DEBUG(0, "Unable to open config database [%s]\n",
+ confdb_location);
talloc_free(cdb);
return EIO;
}
@@ -784,7 +784,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
}
if (res->count != 1) {
- DEBUG(0, ("Unknown domain [%s]\n", name));
+ DEBUG(0, "Unknown domain [%s]\n", name);
ret = ENOENT;
goto done;
}
@@ -797,7 +797,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
tmp = ldb_msg_find_attr_as_string(res->msgs[0], "cn", NULL);
if (!tmp) {
- DEBUG(0, ("Invalid configuration entry, fatal error!\n"));
+ DEBUG(0, "Invalid configuration entry, fatal error!\n");
ret = EINVAL;
goto done;
}
@@ -819,15 +819,15 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
}
}
else {
- DEBUG(0, ("Domain [%s] does not specify an ID provider, disabling!\n",
- domain->name));
+ DEBUG(0, "Domain [%s] does not specify an ID provider, disabling!\n",
+ domain->name);
ret = EINVAL;
goto done;
}
if (strcasecmp(domain->provider, "files") == 0) {
/* The files provider is not valid anymore */
- DEBUG(0, ("The \"files\" provider is invalid\n"));
+ DEBUG(0, "The \"files\" provider is invalid\n");
ret = EINVAL;
goto done;
}
@@ -841,7 +841,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_AUTH_PROVIDER,
NULL);
if (tmp && strcasecmp(tmp, "local") != 0) {
- DEBUG(0, ("Local ID provider does not support [%s] as an AUTH provider.\n", tmp));
+ DEBUG(0, "Local ID provider does not support [%s] as an AUTH provider.\n", tmp);
ret = EINVAL;
goto done;
}
@@ -850,7 +850,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_ACCESS_PROVIDER,
NULL);
if (tmp && strcasecmp(tmp, "permit") != 0) {
- DEBUG(0, ("Local ID provider does not support [%s] as an ACCESS provider.\n", tmp));
+ DEBUG(0, "Local ID provider does not support [%s] as an ACCESS provider.\n", tmp);
ret = EINVAL;
goto done;
}
@@ -859,7 +859,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_CHPASS_PROVIDER,
NULL);
if (tmp && strcasecmp(tmp, "local") != 0) {
- DEBUG(0, ("Local ID provider does not support [%s] as a CHPASS provider.\n", tmp));
+ DEBUG(0, "Local ID provider does not support [%s] as a CHPASS provider.\n", tmp);
ret = EINVAL;
goto done;
}
@@ -877,27 +877,27 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
* superceeded. */
val = ldb_msg_find_attr_as_int(res->msgs[0], CONFDB_DOMAIN_ENUMERATE, 0);
if (val > 0) { /* ok there was a number in here */
- DEBUG(0, ("Warning: enumeration parameter in %s still uses integers! "
+ DEBUG(0, "Warning: enumeration parameter in %s still uses integers! "
"Enumeration is now a boolean and takes true/false values. "
- "Interpreting as true\n", domain->name));
+ "Interpreting as true\n", domain->name);
domain->enumerate = true;
} else { /* assume the new format */
ret = get_entry_as_bool(res->msgs[0], &domain->enumerate,
CONFDB_DOMAIN_ENUMERATE, 0);
if(ret != EOK) {
- DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_ENUMERATE));
+ DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_ENUMERATE);
goto done;
}
}
if (!domain->enumerate) {
- DEBUG(SSSDBG_TRACE_FUNC, ("No enumeration for [%s]!\n", domain->name));
+ DEBUG(SSSDBG_TRACE_FUNC, "No enumeration for [%s]!\n", domain->name);
}
/* Determine if user/group names will be Fully Qualified
* in NSS interfaces */
ret = get_entry_as_bool(res->msgs[0], &domain->fqnames, CONFDB_DOMAIN_FQ, 0);
if(ret != EOK) {
- DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_FQ));
+ DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_FQ);
goto done;
}
@@ -905,8 +905,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS, 0);
if(ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for %s\n",
- CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS));
+ "Invalid value for %s\n",
+ CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS);
goto done;
}
@@ -914,7 +914,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_MINID,
confdb_get_min_id(domain));
if (ret != EOK) {
- DEBUG(0, ("Invalid value for minId\n"));
+ DEBUG(0, "Invalid value for minId\n");
ret = EINVAL;
goto done;
}
@@ -922,13 +922,13 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
ret = get_entry_as_uint32(res->msgs[0], &domain->id_max,
CONFDB_DOMAIN_MAXID, 0);
if (ret != EOK) {
- DEBUG(0, ("Invalid value for maxId\n"));
+ DEBUG(0, "Invalid value for maxId\n");
ret = EINVAL;
goto done;
}
if (domain->id_max && (domain->id_max < domain->id_min)) {
- DEBUG(0, ("Invalid domain range\n"));
+ DEBUG(0, "Invalid domain range\n");
ret = EINVAL;
goto done;
}
@@ -937,14 +937,14 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
ret = get_entry_as_bool(res->msgs[0], &domain->cache_credentials,
CONFDB_DOMAIN_CACHE_CREDS, 0);
if(ret != EOK) {
- DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_CACHE_CREDS));
+ DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_CACHE_CREDS);
goto done;
}
ret = get_entry_as_bool(res->msgs[0], &domain->legacy_passwords,
CONFDB_DOMAIN_LEGACY_PASS, 0);
if(ret != EOK) {
- DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_LEGACY_PASS));
+ DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_LEGACY_PASS);
goto done;
}
@@ -953,8 +953,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT, 5400);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT);
goto done;
}
@@ -964,8 +964,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_USER_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_USER_CACHE_TIMEOUT);
goto done;
}
@@ -975,8 +975,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_GROUP_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_GROUP_CACHE_TIMEOUT);
goto done;
}
@@ -986,8 +986,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_NETGROUP_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_NETGROUP_CACHE_TIMEOUT);
goto done;
}
@@ -997,8 +997,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_SERVICE_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_SERVICE_CACHE_TIMEOUT);
goto done;
}
@@ -1008,8 +1008,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_AUTOFS_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_AUTOFS_CACHE_TIMEOUT);
goto done;
}
@@ -1019,8 +1019,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
entry_cache_timeout);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_SUDO_CACHE_TIMEOUT));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_SUDO_CACHE_TIMEOUT);
goto done;
}
@@ -1030,8 +1030,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
0);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n",
- CONFDB_DOMAIN_REFRESH_EXPIRED_INTERVAL));
+ "Invalid value for [%s]\n",
+ CONFDB_DOMAIN_REFRESH_EXPIRED_INTERVAL);
goto done;
}
@@ -1048,15 +1048,15 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_PAM_PWD_EXPIRATION_WARNING,
-1, &val);
if (ret != EOK) {
- DEBUG(1, ("Failed to read PAM expiration warning, not fatal.\n"));
+ DEBUG(1, "Failed to read PAM expiration warning, not fatal.\n");
val = -1;
}
}
- DEBUG(SSSDBG_TRACE_LIBS, ("pwd_expiration_warning is %d\n", val));
+ DEBUG(SSSDBG_TRACE_LIBS, "pwd_expiration_warning is %d\n", val);
if (val >= 0) {
DEBUG(SSSDBG_CONF_SETTINGS,
- ("Setting domain password expiration warning to %d days\n", val));
+ "Setting domain password expiration warning to %d days\n", val);
/* The value is in days, transform it to seconds */
domain->pwd_expiration_warning = val * 24 * 3600;
}
@@ -1064,7 +1064,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
ret = get_entry_as_uint32(res->msgs[0], &domain->override_gid,
CONFDB_DOMAIN_OVERRIDE_GID, 0);
if (ret != EOK) {
- DEBUG(0, ("Invalid value for [%s]\n", CONFDB_DOMAIN_OVERRIDE_GID));
+ DEBUG(0, "Invalid value for [%s]\n", CONFDB_DOMAIN_OVERRIDE_GID);
goto done;
}
@@ -1122,13 +1122,13 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
ret = get_entry_as_bool(res->msgs[0], &domain->case_sensitive,
CONFDB_DOMAIN_CASE_SENSITIVE, true);
if(ret != EOK) {
- DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_CASE_SENSITIVE));
+ DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_CASE_SENSITIVE);
goto done;
}
if (domain->case_sensitive == false &&
strcasecmp(domain->provider, "local") == 0) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Local ID provider does not support the case insensitive flag\n"));
+ "Local ID provider does not support the case insensitive flag\n");
ret = EINVAL;
goto done;
}
@@ -1141,7 +1141,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
&domain->sd_enumerate, NULL);
if (ret != 0) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Cannot parse %s\n", CONFDB_SUBDOMAIN_ENUMERATE));
+ "Cannot parse %s\n", CONFDB_SUBDOMAIN_ENUMERATE);
goto done;
}
}
@@ -1150,7 +1150,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
CONFDB_DOMAIN_SUBDOMAIN_REFRESH, 14400);
if (ret != EOK || domain->subdomain_refresh_interval == 0) {
DEBUG(SSSDBG_FATAL_FAILURE,
- ("Invalid value for [%s]\n", CONFDB_DOMAIN_SUBDOMAIN_REFRESH));
+ "Invalid value for [%s]\n", CONFDB_DOMAIN_SUBDOMAIN_REFRESH);
goto done;
}
@@ -1182,11 +1182,11 @@ int confdb_get_domains(struct confdb_ctx *cdb,
CONFDB_MONITOR_ACTIVE_DOMAINS,
&domlist);
if (ret == ENOENT) {
- DEBUG(0, ("No domains configured, fatal error!\n"));
+ DEBUG(0, "No domains configured, fatal error!\n");
goto done;
}
if (ret != EOK ) {
- DEBUG(0, ("Fatal error retrieving domains list!\n"));
+ DEBUG(0, "Fatal error retrieving domains list!\n");
goto done;
}
@@ -1195,7 +1195,7 @@ int confdb_get_domains(struct confdb_ctx *cdb,
DLIST_FOR_EACH(domain, cdb->doms) {
if (strcasecmp(domain->name, domlist[i]) == 0) {
DEBUG(SSSDBG_FATAL_FAILURE,
- (SAME_DOMAINS_ERROR_MSG, domlist[i], domain->name));
+ SAME_DOMAINS_ERROR_MSG, domlist[i], domain->name);
sss_log(SSS_LOG_CRIT,
SAME_DOMAINS_ERROR_MSG, domlist[i], domain->name);
@@ -1207,8 +1207,8 @@ int confdb_get_domains(struct confdb_ctx *cdb,
domain = NULL;
ret = confdb_get_domain_internal(cdb, cdb, domlist[i], &domain);
if (ret) {
- DEBUG(0, ("Error (%d [%s]) retrieving domain [%s], skipping!\n",
- ret, strerror(ret), domlist[i]));
+ DEBUG(0, "Error (%d [%s]) retrieving domain [%s], skipping!\n",
+ ret, strerror(ret), domlist[i]);
continue;
}
@@ -1216,7 +1216,7 @@ int confdb_get_domains(struct confdb_ctx *cdb,
}
if (cdb->doms == NULL) {
- DEBUG(0, ("No properly configured domains, fatal error!\n"));
+ DEBUG(0, "No properly configured domains, fatal error!\n");
ret = ENOENT;
goto done;
}