From a3c8390d19593b1e5277d95bfb4ab206d4785150 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 12 Feb 2014 10:12:04 -0500 Subject: Make DEBUG macro invocations variadic Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code: grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/confdb/confdb.c | 146 +++++++++++++++++++++++----------------------- src/confdb/confdb_setup.c | 60 +++++++++---------- 2 files changed, 103 insertions(+), 103 deletions(-) (limited to 'src/confdb') 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; } diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c index 2a34e4f7a..d7bf4bd40 100644 --- a/src/confdb/confdb_setup.c +++ b/src/confdb/confdb_setup.c @@ -56,8 +56,8 @@ int confdb_test(struct confdb_ctx *cdb) if (strcmp(values[0], CONFDB_VERSION) != 0) { /* Existing version does not match executable version */ - DEBUG(1, ("Upgrading confdb version from %s to %s\n", - values[0], CONFDB_VERSION)); + DEBUG(1, "Upgrading confdb version from %s to %s\n", + values[0], CONFDB_VERSION); /* This is recoverable, since we purge the confdb file * when we re-initialize it. @@ -114,8 +114,8 @@ int confdb_create_base(struct confdb_ctx *cdb) while ((ldif = ldb_ldif_read_string(cdb->ldb, &base_ldif))) { ret = ldb_add(cdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("Failed to initialize DB (%d,[%s]), aborting!\n", - ret, ldb_errstring(cdb->ldb))); + DEBUG(0, "Failed to initialize DB (%d,[%s]), aborting!\n", + ret, ldb_errstring(cdb->ldb)); return EIO; } ldb_ldif_read_free(cdb->ldb, ldif); @@ -141,13 +141,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) tmp_ctx = talloc_new(cdb); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory.\n"); return ENOMEM; } init_data = sss_ini_initdata_init(tmp_ctx); if (!init_data) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory.\n"); ret = ENOMEM; goto done; } @@ -156,8 +156,8 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_config_file_open(init_data, config_file); if (ret != EOK) { DEBUG(SSSDBG_TRACE_FUNC, - ("sss_ini_config_file_open failed: %s [%d]\n", strerror(ret), - ret)); + "sss_ini_config_file_open failed: %s [%d]\n", strerror(ret), + ret); if (ret == ENOENT) { /* sss specific error denoting missing configuration file */ ret = ERR_MISSING_CONF; @@ -168,7 +168,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_config_access_check(init_data); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Permission check on config file failed.\n")); + "Permission check on config file failed.\n"); ret = EPERM; goto done; } @@ -179,7 +179,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_stat(init_data); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Status check on config file failed.\n")); + "Status check on config file failed.\n"); ret = errno; goto done; } @@ -189,7 +189,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_mtime(init_data, sizeof(timestr), timestr); if (ret <= 0 || ret >= sizeof(timestr)) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to convert time_t to string ??\n")); + "Failed to convert time_t to string ??\n"); ret = errno ? errno : EFAULT; } ret = confdb_get_string(cdb, tmp_ctx, "config", "lastUpdate", @@ -203,13 +203,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) goto done; } } else { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to get lastUpdate attribute.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to get lastUpdate attribute.\n"); goto done; } ret = sss_ini_get_config(init_data, config_file); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to load configuration\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to load configuration\n"); goto done; } @@ -217,7 +217,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_cfgobj(init_data, "sssd", "config_file_version"); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Internal error determining config_file_version\n")); + "Internal error determining config_file_version\n"); goto done; } @@ -225,8 +225,8 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) if (ret != EOK) { /* No known version. Assumed to be version 1 */ DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file is an old version. " - "Please run configuration upgrade script.\n")); + "Config file is an old version. " + "Please run configuration upgrade script.\n"); ret = EINVAL; goto done; } @@ -234,17 +234,17 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) version = sss_ini_get_int_config_value(init_data, 1, -1, &ret); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file version could not be determined\n")); + "Config file version could not be determined\n"); goto done; } else if (version < CONFDB_VERSION_INT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file is an old version. " - "Please run configuration upgrade script.\n")); + "Config file is an old version. " + "Please run configuration upgrade script.\n"); ret = EINVAL; goto done; } else if (version > CONFDB_VERSION_INT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file version is newer than confdb\n")); + "Config file version is newer than confdb\n"); ret = EINVAL; goto done; } @@ -253,8 +253,8 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = ldb_transaction_start(cdb->ldb); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to start a transaction for " - "updating the configuration\n")); + "Failed to start a transaction for " + "updating the configuration\n"); ret = sysdb_error_to_errno(ret); goto done; } @@ -264,24 +264,24 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = confdb_purge(cdb); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not purge existing configuration\n")); + "Could not purge existing configuration\n"); goto done; } ret = sss_confdb_create_ldif(tmp_ctx, init_data, &config_ldif); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not create LDIF for confdb\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not create LDIF for confdb\n"); goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("LDIF file to import: \n%s", config_ldif)); + DEBUG(SSSDBG_TRACE_LIBS, "LDIF file to import: \n%s", config_ldif); while ((ldif = ldb_ldif_read_string(cdb->ldb, &config_ldif))) { ret = ldb_add(cdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to initialize DB (%d,[%s]), aborting!\n", - ret, ldb_errstring(cdb->ldb))); + "Failed to initialize DB (%d,[%s]), aborting!\n", + ret, ldb_errstring(cdb->ldb)); ret = EIO; goto done; } @@ -294,13 +294,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = confdb_add_param(cdb, true, "config", "lastUpdate", vals); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set last update time on db!\n")); + "Failed to set last update time on db!\n"); goto done; } ret = ldb_transaction_commit(cdb->ldb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -311,7 +311,7 @@ done: if (in_transaction) { sret = ldb_transaction_cancel(cdb->ldb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } -- cgit