diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-02 10:58:19 +0200 |
commit | b0d759c9a604add0573c04b1a4e88e1605e1fdc0 (patch) | |
tree | 15c83ce34cd254a30cc42c212123b7f194c21677 /src/db | |
parent | b9afd88065ecdb9c2cafb2ee767bd61585b31b8f (diff) | |
download | sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.gz sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.xz sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.zip |
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
(identical to commit a3c8390d19593b1e5277d95bfb4ab206d4785150):
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 <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb.c | 102 | ||||
-rw-r--r-- | src/db/sysdb_autofs.c | 78 | ||||
-rw-r--r-- | src/db/sysdb_idmap.c | 44 | ||||
-rw-r--r-- | src/db/sysdb_ops.c | 308 | ||||
-rw-r--r-- | src/db/sysdb_ranges.c | 38 | ||||
-rw-r--r-- | src/db/sysdb_search.c | 24 | ||||
-rw-r--r-- | src/db/sysdb_selinux.c | 28 | ||||
-rw-r--r-- | src/db/sysdb_services.c | 74 | ||||
-rw-r--r-- | src/db/sysdb_ssh.c | 46 | ||||
-rw-r--r-- | src/db/sysdb_subdomains.c | 44 | ||||
-rw-r--r-- | src/db/sysdb_sudo.c | 60 | ||||
-rw-r--r-- | src/db/sysdb_upgrade.c | 128 |
12 files changed, 487 insertions, 487 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c index 592cadc1a..ff60330e9 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -52,7 +52,7 @@ errno_t sysdb_ldb_connect(TALLOC_CTX *mem_ctx, const char *filename, mod_path = getenv(LDB_MODULES_PATH); if (mod_path != NULL) { - DEBUG(9, ("Setting ldb module path to [%s].\n", mod_path)); + DEBUG(9, "Setting ldb module path to [%s].\n", mod_path); ldb_set_modules_dir(ldb, mod_path); } @@ -667,7 +667,7 @@ int sysdb_attrs_add_lc_name_alias(struct sysdb_attrs *attrs, lc_str = sss_tc_utf8_str_tolower(attrs, value); if (lc_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot convert name to lowercase\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot convert name to lowercase\n"); return ENOMEM; } @@ -726,21 +726,21 @@ int sysdb_attrs_users_from_str_list(struct sysdb_attrs *attrs, } el->values = vals; - DEBUG(9, ("Adding %d members to existing %d ones\n", - num, el->num_values)); + DEBUG(9, "Adding %d members to existing %d ones\n", + num, el->num_values); for (i = 0, j = el->num_values; i < num; i++) { member = sysdb_user_strdn(el->values, domain, list[i]); if (!member) { - DEBUG(4, ("Failed to get user dn for [%s]\n", list[i])); + DEBUG(4, "Failed to get user dn for [%s]\n", list[i]); continue; } el->values[j].data = (uint8_t *)member; el->values[j].length = strlen(member); j++; - DEBUG(7, (" member #%d: [%s]\n", i, member)); + DEBUG(7, " member #%d: [%s]\n", i, member); } el->num_values = j; @@ -814,8 +814,8 @@ int sysdb_error_to_errno(int ldberr) return EINVAL; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("LDB returned unexpected error: [%s]\n", - ldb_strerror(ldberr))); + "LDB returned unexpected error: [%s]\n", + ldb_strerror(ldberr)); return EFAULT; } } @@ -828,7 +828,7 @@ int sysdb_transaction_start(struct sysdb_ctx *sysdb) ret = ldb_transaction_start(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -839,7 +839,7 @@ int sysdb_transaction_commit(struct sysdb_ctx *sysdb) ret = ldb_transaction_commit(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -850,7 +850,7 @@ int sysdb_transaction_cancel(struct sysdb_ctx *sysdb) ret = ldb_transaction_cancel(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -911,10 +911,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) " "for domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -941,10 +941,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) " "for domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -971,10 +971,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) for " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) for " "domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -1046,11 +1046,11 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, if (ret != EOK) { goto done; } - DEBUG(5, ("DB File for %s: %s\n", domain->name, sysdb->ldb_file)); + DEBUG(5, "DB File for %s: %s\n", domain->name, sysdb->ldb_file); ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); goto done; } @@ -1105,14 +1105,14 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, if (!allow_upgrade) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Wrong DB version (got %s expected %s)\n", - version, SYSDB_VERSION)); + "Wrong DB version (got %s expected %s)\n", + version, SYSDB_VERSION); ret = sysdb_version_check(SYSDB_VERSION, version); goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Upgrading DB [%s] from version: %s\n", - domain->name, version)); + DEBUG(SSSDBG_CONF_SETTINGS, "Upgrading DB [%s] from version: %s\n", + domain->name, version); if (strcmp(version, SYSDB_VERSION_0_3) == 0) { ret = sysdb_upgrade_03(sysdb, &version); @@ -1212,13 +1212,13 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, talloc_zfree(sysdb->ldb); ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_ldb_connect failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n"); } goto done; } - DEBUG(0,("Unknown DB version [%s], expected [%s] for domain %s!\n", - version?version:"not found", SYSDB_VERSION, domain->name)); + DEBUG(0,"Unknown DB version [%s], expected [%s] for domain %s!\n", + version?version:"not found", SYSDB_VERSION, domain->name); ret = sysdb_version_check(SYSDB_VERSION, version); goto done; } @@ -1229,8 +1229,8 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, while ((ldif = ldb_ldif_read_string(sysdb->ldb, &base_ldif))) { ret = ldb_add(sysdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n", - ret, ldb_errstring(sysdb->ldb), domain->name)); + DEBUG(0, "Failed to initialize DB (%d, [%s]) for domain %s!\n", + ret, ldb_errstring(sysdb->ldb), domain->name); ret = EIO; goto done; } @@ -1251,7 +1251,7 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, talloc_zfree(sysdb->ldb); ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); } done: @@ -1328,7 +1328,7 @@ int sysdb_attrs_replace_name(struct sysdb_attrs *attrs, const char *oldname, e = &(attrs->a[i]); } if (strcasecmp(newname, attrs->a[i].name) == 0) { - DEBUG(3, ("New attribute name [%s] already exists.\n", newname)); + DEBUG(3, "New attribute name [%s] already exists.\n", newname); return EEXIST; } } @@ -1336,7 +1336,7 @@ int sysdb_attrs_replace_name(struct sysdb_attrs *attrs, const char *oldname, if (e != NULL) { dummy = talloc_strdup(attrs, newname); if (dummy == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); return ENOMEM; } @@ -1458,7 +1458,7 @@ errno_t sysdb_get_bool(struct sysdb_ctx *sysdb, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } @@ -1515,7 +1515,7 @@ errno_t sysdb_set_bool(struct sysdb_ctx *sysdb, } } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } else { @@ -1641,7 +1641,7 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, goto done; } if (orig_dn_el->num_values == 0) { - DEBUG(1, ("Original DN is not available.\n")); + DEBUG(1, "Original DN is not available.\n"); ret = EINVAL; goto done; } else if (orig_dn_el->num_values == 1) { @@ -1650,26 +1650,26 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, &rdn_attr, &rdn_val); if (ret != EOK) { - DEBUG(1, ("Could not get rdn from [%s]\n", - (const char *) orig_dn_el->values[0].data)); + DEBUG(1, "Could not get rdn from [%s]\n", + (const char *) orig_dn_el->values[0].data); goto done; } } else { - DEBUG(1, ("Should not have more than one origDN\n")); + DEBUG(1, "Should not have more than one origDN\n"); ret = EINVAL; goto done; } /* First check whether the attribute name matches */ - DEBUG(8, ("Comparing attribute names [%s] and [%s]\n", - rdn_attr, ldap_attr)); + DEBUG(8, "Comparing attribute names [%s] and [%s]\n", + rdn_attr, ldap_attr); if (strcasecmp(rdn_attr, ldap_attr) != 0) { /* Multiple entries, and the RDN attribute doesn't match. * We have no way of resolving this deterministically, * so we'll use the first value as a fallback. */ - DEBUG(3, ("The entry has multiple names and the RDN attribute does " - "not match. Will use the first value as fallback.\n")); + DEBUG(3, "The entry has multiple names and the RDN attribute does " + "not match. Will use the first value as fallback.\n"); *_primary = (const char *)sysdb_name_el->values[0].data; ret = EOK; goto done; @@ -1690,7 +1690,7 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, * throw up our hands. There's no deterministic way to * decide which name is correct. */ - DEBUG(1, ("Cannot save entry. Unable to determine groupname\n")); + DEBUG(1, "Cannot save entry. Unable to determine groupname\n"); ret = EINVAL; goto done; } @@ -1699,8 +1699,8 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, done: if (ret != EOK) { - DEBUG(1, ("Could not determine primary name: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Could not determine primary name: [%d][%s]\n", + ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -1753,7 +1753,7 @@ errno_t sysdb_attrs_get_aliases(TALLOC_CTX *mem_ctx, if (lowercase) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Domain is case-insensitive; will add lowercased aliases\n")); + "Domain is case-insensitive; will add lowercased aliases\n"); } ai = 0; @@ -1831,7 +1831,7 @@ errno_t sysdb_attrs_primary_name_list(struct sysdb_ctx *sysdb, ldap_attr, &name); if (ret != EOK) { - DEBUG(1, ("Could not determine primary name\n")); + DEBUG(1, "Could not determine primary name\n"); /* Skip and continue. Don't advance 'j' */ continue; } @@ -1877,7 +1877,7 @@ errno_t sysdb_get_real_name(TALLOC_CTX *mem_ctx, ret = sysdb_getpwnam(tmp_ctx, sysdb, domain, name, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot canonicalize username\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot canonicalize username\n"); goto done; } @@ -1887,14 +1887,14 @@ errno_t sysdb_get_real_name(TALLOC_CTX *mem_ctx, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sysdb_getpwnam returned count: [%d]\n", res->count)); + "sysdb_getpwnam returned count: [%d]\n", res->count); ret = EIO; goto done; } cname = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_NAME, NULL); if (!cname) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no name?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no name?\n"); ret = ENOENT; goto done; } @@ -1915,14 +1915,14 @@ errno_t sysdb_msg2attrs(TALLOC_CTX *mem_ctx, size_t count, a = talloc_array(mem_ctx, struct sysdb_attrs *, count); if (a == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); return ENOMEM; } for (i = 0; i < count; i++) { a[i] = talloc(a, struct sysdb_attrs); if (a[i] == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); talloc_free(a); return ENOMEM; } diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c index cb9685623..ce214871a 100644 --- a/src/db/sysdb_autofs.c +++ b/src/db/sysdb_autofs.c @@ -110,7 +110,7 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, errno_t ret; TALLOC_CTX *tmp_ctx; - DEBUG(SSSDBG_TRACE_FUNC, ("Adding autofs map %s\n", autofsmapname)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding autofs map %s\n", autofsmapname); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -128,29 +128,29 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_AUTOFS_MAP_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_MAP_NAME, autofsmapname); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map name [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_time_t(attrs, SYSDB_LAST_UPDATE, now); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb lastUpdate [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb lastUpdate [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -158,15 +158,15 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, ((cache_timeout) ? (now + cache_timeout) : 0)); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb cache expire [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_store_custom(sysdb_ctx, domain, name, AUTOFS_MAP_SUBDIR, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_custom failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -181,7 +181,7 @@ sysdb_delete_autofsmap(struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting autofs map %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting autofs map %s\n", name); return sysdb_delete_custom(sysdb_ctx, domain, name, AUTOFS_MAP_SUBDIR); } @@ -211,8 +211,8 @@ sysdb_get_map_byname(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(tmp_ctx, map_name, &safe_map_name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot sanitize map [%s] error [%d]: %s\n", - map_name, ret, strerror(ret))); + "Cannot sanitize map [%s] error [%d]: %s\n", + map_name, ret, strerror(ret)); goto done; } @@ -228,17 +228,17 @@ sysdb_get_map_byname(TALLOC_CTX *mem_ctx, &count, &msgs); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up autofs map [%s]", safe_map_name)); + "Error looking up autofs map [%s]", safe_map_name); goto done; } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such map\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such map\n"); *_map = NULL; goto done; } if (count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("More than one map named %s\n", safe_map_name)); + "More than one map named %s\n", safe_map_name); goto done; } @@ -264,7 +264,7 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, const char *name; DEBUG(SSSDBG_TRACE_FUNC, - ("Adding autofs entry [%s] - [%s]\n", key, value)); + "Adding autofs entry [%s] - [%s]\n", key, value); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -282,22 +282,22 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_AUTOFS_ENTRY_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry object class [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_KEY, key); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry key [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_VALUE, value); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry key [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -309,8 +309,8 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -372,7 +372,7 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, struct ldb_message **msgs; struct ldb_dn *mapdn; - DEBUG(SSSDBG_TRACE_FUNC, ("Getting entries for map %s\n", mapname)); + DEBUG(SSSDBG_TRACE_FUNC, "Getting entries for map %s\n", mapname); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -395,10 +395,10 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, ret = sysdb_search_entry(tmp_ctx, sysdb, mapdn, LDB_SCOPE_ONELEVEL, filter, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb search failed: %d\n", ret)); + DEBUG(SSSDBG_OP_FAILURE, "sysdb search failed: %d\n", ret); goto done; } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No entries for the map\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No entries for the map\n"); *_count = 0; *_entries = NULL; goto done; @@ -407,8 +407,8 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, *_count = count; *_entries = talloc_steal(mem_ctx, msgs); ret = EOK; - DEBUG(SSSDBG_TRACE_INTERNAL, ("found %zu entries for map %s\n", - count, mapname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "found %zu entries for map %s\n", + count, mapname); done: talloc_free(tmp_ctx); return ret; @@ -477,7 +477,7 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb, &count, &msgs); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up autofs maps")); + "Error looking up autofs maps"); goto done; } else if (ret == ENOENT) { ret = EOK; @@ -497,7 +497,7 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -505,21 +505,21 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("A map with no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "A map with no name?\n"); continue; } ret = sysdb_set_autofsmap_attr(sysdb, domain, name, sys_attrs, SYSDB_MOD_REP); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not expire map %s\n", name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not expire map %s\n", name); continue; } } ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not commit transaction\n"); goto done; } in_transaction = false; @@ -529,7 +529,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c index 7b46ae66b..1b8f4847f 100644 --- a/src/db/sysdb_idmap.c +++ b/src/db/sysdb_idmap.c @@ -37,7 +37,7 @@ sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, return NULL; } - DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP"\n", clean_sid, domain->name)); + DEBUG(SSSDBG_TRACE_ALL, SYSDB_TMPL_IDMAP"\n", clean_sid, domain->name); dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_IDMAP, clean_sid, domain->name); @@ -83,7 +83,7 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -102,8 +102,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, } else if (ret == ENOENT) { /* Create a new mapping */ DEBUG(SSSDBG_CONF_SETTINGS, - ("Adding new ID mapping [%s][%s][%lu]\n", - dom_name, dom_sid, (unsigned long)slice_num)); + "Adding new ID mapping [%s][%s][%lu]\n", + dom_name, dom_sid, (unsigned long)slice_num); /* Add the objectClass */ lret = ldb_msg_add_empty(update_msg, SYSDB_OBJECTCLASS, @@ -170,8 +170,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, lret = ldb_add(sysdb->ldb, update_msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add mapping: [%s]\n", - ldb_strerror(lret))); + "Failed to add mapping: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } @@ -187,17 +187,17 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, -1); if (old_slice == -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not identify original slice for SID [%s]\n", - dom_sid)); + "Could not identify original slice for SID [%s]\n", + dom_sid); ret = ENOENT; goto done; } if (slice_num != old_slice) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Detected attempt to change slice value for sid [%s] " + "Detected attempt to change slice value for sid [%s] " "This will break existing users. Refusing to perform.\n", - dom_sid)); + dom_sid); ret = EINVAL; goto done; } @@ -209,8 +209,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, old_name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (!old_name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not identify original domain name of SID [%s]\n", - dom_sid)); + "Could not identify original domain name of SID [%s]\n", + dom_sid); ret = ENOENT; goto done; } @@ -220,14 +220,14 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, * make any changes here. Just return success. */ DEBUG(SSSDBG_TRACE_LIBS, - ("No changes needed, canceling transaction\n")); + "No changes needed, canceling transaction\n"); ret = EOK; goto done; } else { /* The name has changed. Replace it */ DEBUG(SSSDBG_CONF_SETTINGS, - ("Changing domain name of SID [%s] from [%s] to [%s]\n", - dom_sid, old_name, dom_name)); + "Changing domain name of SID [%s] from [%s] to [%s]\n", + dom_sid, old_name, dom_name); /* Set the new name */ lret = ldb_msg_add_empty(update_msg, SYSDB_NAME, @@ -248,8 +248,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, lret = ldb_modify(sysdb->ldb, update_msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to update mapping: [%s]\n", - ldb_strerror(lret))); + "Failed to update mapping: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } @@ -258,7 +258,7 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit transaction: [%s]\n", strerror(ret))); + "Could not commit transaction: [%s]\n", strerror(ret)); goto done; } in_transaction = false; @@ -268,7 +268,7 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction\n")); + "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -291,7 +291,7 @@ sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return ENOMEM; - DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP_BASE"\n", domain->name)); + DEBUG(SSSDBG_TRACE_ALL, SYSDB_TMPL_IDMAP_BASE"\n", domain->name); base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_IDMAP_BASE, domain->name); @@ -304,8 +304,8 @@ sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx, LDB_SCOPE_SUBTREE, attrs, SYSDB_IDMAP_FILTER); if (lret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not locate ID mappings: [%s]\n", - ldb_strerror(lret))); + "Could not locate ID mappings: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 95354d988..f2f4e62b3 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -132,8 +132,8 @@ int sysdb_delete_entry(struct sysdb_ctx *sysdb, } /* fall through */ default: - DEBUG(1, ("LDB Error: %s(%d)\nError Message: [%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "LDB Error: %s(%d)\nError Message: [%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); return sysdb_error_to_errno(ret); } } @@ -170,19 +170,19 @@ int sysdb_delete_recursive(struct sysdb_ctx *sysdb, ret = EOK; } if (ret) { - DEBUG(6, ("Search error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Search error: %d (%s)\n", ret, strerror(ret)); } goto done; } - DEBUG(SSSDBG_TRACE_ALL, ("Found [%zu] items to delete.\n", msgs_count)); + DEBUG(SSSDBG_TRACE_ALL, "Found [%zu] items to delete.\n", msgs_count); qsort(msgs, msgs_count, sizeof(struct ldb_message *), compare_ldb_dn_comp_num); for (i = 0; i < msgs_count; i++) { - DEBUG(9 ,("Trying to delete [%s].\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(9 ,"Trying to delete [%s].\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = sysdb_delete_entry(sysdb, msgs[i]->dn, false); if (ret) { @@ -280,10 +280,10 @@ int sysdb_search_entry_by_sid_str(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); @@ -344,10 +344,10 @@ int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -400,10 +400,10 @@ int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); @@ -461,10 +461,10 @@ int sysdb_search_group_by_name(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -517,10 +517,10 @@ int sysdb_search_group_by_gid(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); @@ -578,10 +578,10 @@ int sysdb_search_netgroup_by_name(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -633,17 +633,17 @@ int sysdb_set_entry_attr(struct sysdb_ctx *sysdb, lret = ldb_modify(sysdb->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 = sysdb_error_to_errno(lret); done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -793,7 +793,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, case EOK: new_id = get_attr_as_uint32(msgs[0], SYSDB_NEXTID); if (new_id == (uint32_t)(-1)) { - DEBUG(1, ("Invalid Next ID in domain %s\n", domain->name)); + DEBUG(1, "Invalid Next ID in domain %s\n", domain->name); ret = ERANGE; goto done; } @@ -803,8 +803,8 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, } if ((domain->id_max != 0) && (new_id > domain->id_max)) { - DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n", - new_id, domain->id_max)); + DEBUG(0, "Failed to allocate new id, out of range (%u/%u)\n", + new_id, domain->id_max); ret = ERANGE; goto done; } @@ -838,7 +838,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, SYSDB_GIDNUM, new_id); } if (!filter) { - DEBUG(6, ("Error: Out of memory\n")); + DEBUG(6, "Error: Out of memory\n"); ret = ENOMEM; goto done; } @@ -863,8 +863,8 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, /* check again we are not falling out of range */ if ((domain->id_max != 0) && (new_id > domain->id_max)) { - DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n", - new_id, domain->id_max)); + DEBUG(0, "Failed to allocate new id, out of range (%u/%u)\n", + new_id, domain->id_max); ret = ERANGE; goto done; } @@ -883,7 +883,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, /* finally store the new next id */ msg = ldb_msg_new(tmp_ctx); if (!msg) { - DEBUG(6, ("Error: Out of memory\n")); + DEBUG(6, "Error: Out of memory\n"); ret = ENOMEM; goto done; } @@ -908,7 +908,7 @@ done: ldb_transaction_cancel(sysdb->ldb); } if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -989,7 +989,7 @@ int sysdb_add_basic_user(struct sysdb_ctx *sysdb, done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1199,7 +1199,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, if (domain->mpg) { if (gid != 0) { - DEBUG(0, ("Cannot add user with arbitrary GID in MPG domain!\n")); + DEBUG(0, "Cannot add user with arbitrary GID in MPG domain!\n"); return EINVAL; } gid = uid; @@ -1208,16 +1208,16 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, if (domain->id_max != 0 && uid != 0 && (uid < domain->id_min || uid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied uid [%"SPRIuid"] is not in the allowed range " - "[%d-%d].\n", uid, domain->id_min, domain->id_max)); + "Supplied uid [%"SPRIuid"] is not in the allowed range " + "[%d-%d].\n", uid, domain->id_min, domain->id_max); return ERANGE; } if (domain->id_max != 0 && gid != 0 && (gid < domain->id_min || gid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied gid [%"SPRIgid"] is not in the allowed range " - "[%d-%d].\n", gid, domain->id_min, domain->id_max)); + "Supplied gid [%"SPRIgid"] is not in the allowed range " + "[%d-%d].\n", gid, domain->id_min, domain->id_max); return ERANGE; } @@ -1324,7 +1324,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); } else { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1377,7 +1377,7 @@ int sysdb_add_basic_group(struct sysdb_ctx *sysdb, done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1402,8 +1402,8 @@ int sysdb_add_group(struct sysdb_ctx *sysdb, if (domain->id_max != 0 && gid != 0 && (gid < domain->id_min || gid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied gid [%"SPRIgid"] is not in the allowed range " - "[%d-%d].\n", gid, domain->id_min, domain->id_max)); + "Supplied gid [%"SPRIgid"] is not in the allowed range " + "[%d-%d].\n", gid, domain->id_min, domain->id_max); return ERANGE; } @@ -1491,7 +1491,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); } else { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1554,7 +1554,7 @@ int sysdb_add_incomplete_group(struct sysdb_ctx *sysdb, done: if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1598,7 +1598,7 @@ int sysdb_mod_group_member(struct sysdb_ctx *sysdb, fail: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -1647,7 +1647,7 @@ int sysdb_add_basic_netgroup(struct sysdb_ctx *sysdb, done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -1711,7 +1711,7 @@ int sysdb_add_netgroup(struct sysdb_ctx *sysdb, SYSDB_MEMBER_NETGROUP, missing); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not remove missing attributes\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not remove missing attributes\n"); } } @@ -1722,7 +1722,7 @@ done: } if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1774,7 +1774,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } @@ -1809,8 +1809,8 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("A user with the same UID [%llu] was removed from the " - "cache\n", (unsigned long long) uid)); + "A user with the same UID [%llu] was removed from the " + "cache\n", (unsigned long long) uid); ret = sysdb_add_user(sysdb, domain, name, uid, gid, gecos, homedir, shell, orig_dn, attrs, cache_timeout, now); } @@ -1819,7 +1819,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, if (ret == EOK) { goto done; } else { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add user\n"); goto fail; } } @@ -1871,14 +1871,14 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, SYSDB_MEMBER_USER, remove_attrs); if (ret != EOK) { - DEBUG(4, ("Could not remove missing attributes\n")); + DEBUG(4, "Could not remove missing attributes\n"); } } done: ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } @@ -1888,12 +1888,12 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1927,8 +1927,8 @@ int sysdb_store_group(struct sysdb_ctx *sysdb, name, src_attrs, &msg); if (ret && ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sysdb_search_group_by_name failed for %s with: [%d][%s].\n", - name, ret, strerror(ret))); + "sysdb_search_group_by_name failed for %s with: [%d][%s].\n", + name, ret, strerror(ret)); goto done; } if (ret == ENOENT) { @@ -1969,8 +1969,8 @@ int sysdb_store_group(struct sysdb_ctx *sysdb, goto done; } DEBUG(SSSDBG_MINOR_FAILURE, - ("A group with the same GID [%llu] was removed from the " - "cache\n", (unsigned long long) gid)); + "A group with the same GID [%llu] was removed from the " + "cache\n", (unsigned long long) gid); ret = sysdb_add_group(sysdb, domain, name, gid, attrs, cache_timeout, now); } @@ -1995,7 +1995,7 @@ int sysdb_store_group(struct sysdb_ctx *sysdb, done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2098,13 +2098,13 @@ int sysdb_cache_password(struct sysdb_ctx *sysdb, ret = s3crypt_gen_salt(tmp_ctx, &salt); if (ret) { - DEBUG(4, ("Failed to generate random salt.\n")); + DEBUG(4, "Failed to generate random salt.\n"); goto fail; } ret = s3crypt_sha512(tmp_ctx, password, salt, &hash); if (ret) { - DEBUG(4, ("Failed to create password hash.\n")); + DEBUG(4, "Failed to create password hash.\n"); goto fail; } @@ -2135,7 +2135,7 @@ int sysdb_cache_password(struct sysdb_ctx *sysdb, fail: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2161,11 +2161,11 @@ int sysdb_search_custom(TALLOC_CTX *mem_ctx, basedn = sysdb_custom_subtree_dn(sysdb, mem_ctx, domain, subtree_name); if (basedn == NULL) { - DEBUG(1, ("sysdb_custom_subtree_dn failed.\n")); + DEBUG(1, "sysdb_custom_subtree_dn failed.\n"); return ENOMEM; } if (!ldb_dn_validate(basedn)) { - DEBUG(1, ("Failed to create DN.\n")); + DEBUG(1, "Failed to create DN.\n"); return EINVAL; } @@ -2202,12 +2202,12 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, basedn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (basedn == NULL) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } if (!ldb_dn_validate(basedn)) { - DEBUG(1, ("Failed to create DN.\n")); + DEBUG(1, "Failed to create DN.\n"); ret = EINVAL; goto done; } @@ -2219,7 +2219,7 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, } if (count > 1) { - DEBUG(1, ("More than one result found.\n")); + DEBUG(1, "More than one result found.\n"); ret = EFAULT; goto done; } @@ -2286,7 +2286,7 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb, msg->dn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (!msg->dn) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } @@ -2318,14 +2318,14 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb, ret = ldb_modify(sysdb->ldb, msg); } if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to store custom entry: %s(%d)[%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "Failed to store custom entry: %s(%d)[%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); } done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } else { ret = ldb_transaction_commit(sysdb->ldb); @@ -2358,7 +2358,7 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb, dn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (dn == NULL) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } @@ -2372,8 +2372,8 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb, break; default: - DEBUG(1, ("LDB Error: %s(%d)\nError Message: [%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "LDB Error: %s(%d)\nError Message: [%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); break; } @@ -2469,10 +2469,10 @@ int sysdb_asq_search(TALLOC_CTX *mem_ctx, fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2501,20 +2501,20 @@ int sysdb_search_users(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_USER_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; } filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_UC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search users with filter: %s\n", filter)); + "Search users with filter: %s\n", filter); ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2528,10 +2528,10 @@ int sysdb_search_users(TALLOC_CTX *mem_ctx, fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2574,7 +2574,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb, c_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); c_uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (c_name == NULL || c_uid == 0) { - DEBUG(2, ("Attribute is missing but this should never happen!\n")); + DEBUG(2, "Attribute is missing but this should never happen!\n"); ret = EFAULT; goto fail; } @@ -2637,7 +2637,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb, return EOK; fail: - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); talloc_zfree(tmp_ctx); return ret; } @@ -2666,20 +2666,20 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_GROUP_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; } filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_GC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search groups with filter: %s\n", filter)); + "Search groups with filter: %s\n", filter); ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2693,10 +2693,10 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx, fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2736,7 +2736,7 @@ int sysdb_delete_group(struct sysdb_ctx *sysdb, c_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); c_gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); if (c_name == NULL || c_gid == 0) { - DEBUG(2, ("Attribute is missing but this should never happen!\n")); + DEBUG(2, "Attribute is missing but this should never happen!\n"); ret = EFAULT; goto fail; } @@ -2756,7 +2756,7 @@ int sysdb_delete_group(struct sysdb_ctx *sysdb, return EOK; fail: - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); talloc_zfree(tmp_ctx); return ret; } @@ -2784,19 +2784,19 @@ int sysdb_search_netgroups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; } filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_NC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } - DEBUG(6, ("Search netgroups with filter: %s\n", filter)); + DEBUG(6, "Search netgroups with filter: %s\n", filter); ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2810,9 +2810,9 @@ int sysdb_search_netgroups(TALLOC_CTX *mem_ctx, fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("Entry not found\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Entry not found\n"); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2838,11 +2838,11 @@ int sysdb_delete_netgroup(struct sysdb_ctx *sysdb, ret = sysdb_search_netgroup_by_name(tmp_ctx, sysdb, domain, name, NULL, &msg); if (ret != EOK && ret != ENOENT) { - DEBUG(6, ("sysdb_search_netgroup_by_name failed: %d (%s)\n", - ret, strerror(ret))); + DEBUG(6, "sysdb_search_netgroup_by_name failed: %d (%s)\n", + ret, strerror(ret)); goto done; } else if (ret == ENOENT) { - DEBUG(6, ("Netgroup does not exist, nothing to delete\n")); + DEBUG(6, "Netgroup does not exist, nothing to delete\n"); ret = EOK; goto done; } @@ -2854,7 +2854,7 @@ int sysdb_delete_netgroup(struct sysdb_ctx *sysdb, done: if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -2878,14 +2878,14 @@ int sysdb_delete_by_sid(struct sysdb_ctx *sysdb, ret = sysdb_search_object_by_sid(tmp_ctx, sysdb, domain, sid_str, NULL, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("search by sid failed: %d (%s)\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "search by sid failed: %d (%s)\n", + ret, strerror(ret)); goto done; } if (res->count > 1) { - DEBUG(SSSDBG_FATAL_FAILURE, ("getbysid call returned more than one " \ - "result !?!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "getbysid call returned more than one " \ + "result !?!\n"); ret = EIO; goto done; } @@ -2903,7 +2903,7 @@ int sysdb_delete_by_sid(struct sysdb_ctx *sysdb, done: if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -2939,8 +2939,8 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb, CONFDB_DEFAULT_PAM_FAILED_LOGIN_ATTEMPTS, &allowed_failed_login_attempts); if (ret != EOK) { - DEBUG(1, ("Failed to read the number of allowed failed login " - "attempts.\n")); + DEBUG(1, "Failed to read the number of allowed failed login " + "attempts.\n"); ret = ERR_INTERNAL; goto done; } @@ -2949,30 +2949,30 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb, CONFDB_DEFAULT_PAM_FAILED_LOGIN_DELAY, &failed_login_delay); if (ret != EOK) { - DEBUG(1, ("Failed to read the failed login delay.\n")); + DEBUG(1, "Failed to read the failed login delay.\n"); ret = ERR_INTERNAL; goto done; } - DEBUG(9, ("Failed login attempts [%d], allowed failed login attempts [%d], " + DEBUG(9, "Failed login attempts [%d], allowed failed login attempts [%d], " "failed login delay [%d].\n", *failed_login_attempts, - allowed_failed_login_attempts, failed_login_delay)); + allowed_failed_login_attempts, failed_login_delay); if (allowed_failed_login_attempts) { if (*failed_login_attempts >= allowed_failed_login_attempts) { if (failed_login_delay) { end = last_failed_login + (failed_login_delay * 60); if (end < time(NULL)) { - DEBUG(7, ("failed_login_delay has passed, " - "resetting failed_login_attempts.\n")); + DEBUG(7, "failed_login_delay has passed, " + "resetting failed_login_attempts.\n"); *failed_login_attempts = 0; } else { - DEBUG(7, ("login delayed until %lld.\n", (long long) end)); + DEBUG(7, "login delayed until %lld.\n", (long long) end); *delayed_until = end; ret = ERR_AUTH_DENIED; goto done; } } else { - DEBUG(4, ("Too many failed logins.\n")); + DEBUG(4, "Too many failed logins.\n"); ret = ERR_AUTH_DENIED; goto done; } @@ -3013,22 +3013,22 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, int ret; if (name == NULL || *name == '\0') { - DEBUG(1, ("Missing user name.\n")); + DEBUG(1, "Missing user name.\n"); return EINVAL; } if (cdb == NULL) { - DEBUG(1, ("Missing config db context.\n")); + DEBUG(1, "Missing config db context.\n"); return EINVAL; } if (sysdb == NULL) { - DEBUG(1, ("Missing sysdb db context.\n")); + DEBUG(1, "Missing sysdb db context.\n"); return EINVAL; } if (!domain->cache_credentials) { - DEBUG(3, ("Cached credentials not available.\n")); + DEBUG(3, "Cached credentials not available.\n"); return EINVAL; } @@ -3047,8 +3047,8 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, name, attrs, &ldb_msg); if (ret != EOK) { - DEBUG(1, ("sysdb_search_user_by_name failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_search_user_by_name failed [%d][%s].\n", + ret, strerror(ret)); if (ret == ENOENT) ret = ERR_ACCOUNT_UNKNOWN; goto done; } @@ -3061,16 +3061,16 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY, CONFDB_PAM_CRED_TIMEOUT, 0, &cred_expiration); if (ret != EOK) { - DEBUG(1, ("Failed to read expiration time of offline credentials.\n")); + DEBUG(1, "Failed to read expiration time of offline credentials.\n"); goto done; } - DEBUG(9, ("Offline credentials expiration is [%d] days.\n", - cred_expiration)); + DEBUG(9, "Offline credentials expiration is [%d] days.\n", + cred_expiration); if (cred_expiration) { expire_date = lastLogin + (cred_expiration * 86400); if (expire_date < time(NULL)) { - DEBUG(4, ("Cached user entry is too old.\n")); + DEBUG(4, "Cached user entry is too old.\n"); expire_date = 0; ret = ERR_CACHED_CREDS_EXPIRED; goto done; @@ -3082,7 +3082,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = check_failed_login_attempts(cdb, ldb_msg, &failed_login_attempts, &delayed_until); if (ret != EOK) { - DEBUG(1, ("Failed to check login attempts\n")); + DEBUG(1, "Failed to check login attempts\n"); goto done; } @@ -3090,28 +3090,28 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, userhash = ldb_msg_find_attr_as_string(ldb_msg, SYSDB_CACHEDPWD, NULL); if (userhash == NULL || *userhash == '\0') { - DEBUG(4, ("Cached credentials not available.\n")); + DEBUG(4, "Cached credentials not available.\n"); ret = ERR_NO_CACHED_CREDS; goto done; } ret = s3crypt_sha512(tmp_ctx, password, userhash, &comphash); if (ret) { - DEBUG(4, ("Failed to create password hash.\n")); + DEBUG(4, "Failed to create password hash.\n"); ret = ERR_INTERNAL; goto done; } update_attrs = sysdb_new_attrs(tmp_ctx); if (update_attrs == NULL) { - DEBUG(1, ("sysdb_new_attrs failed.\n")); + DEBUG(1, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } if (strcmp(userhash, comphash) == 0) { /* TODO: probable good point for audit logging */ - DEBUG(4, ("Hashes do match!\n")); + DEBUG(4, "Hashes do match!\n"); authentication_successful = true; if (just_check) { @@ -3122,8 +3122,8 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_time_t(update_attrs, SYSDB_LAST_LOGIN, time(NULL)); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_time_t failed, " - "but authentication is successful.\n")); + DEBUG(3, "sysdb_attrs_add_time_t failed, " + "but authentication is successful.\n"); ret = EOK; goto done; } @@ -3131,22 +3131,22 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_uint32(update_attrs, SYSDB_FAILED_LOGIN_ATTEMPTS, 0U); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_uint32 failed, " - "but authentication is successful.\n")); + DEBUG(3, "sysdb_attrs_add_uint32 failed, " + "but authentication is successful.\n"); ret = EOK; goto done; } } else { - DEBUG(4, ("Authentication failed.\n")); + DEBUG(4, "Authentication failed.\n"); authentication_successful = false; ret = sysdb_attrs_add_time_t(update_attrs, SYSDB_LAST_FAILED_LOGIN, time(NULL)); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_time_t failed\n.")); + DEBUG(3, "sysdb_attrs_add_time_t failed\n."); goto done; } @@ -3154,7 +3154,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, SYSDB_FAILED_LOGIN_ATTEMPTS, ++failed_login_attempts); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_uint32 failed.\n")); + DEBUG(3, "sysdb_attrs_add_uint32 failed.\n"); goto done; } } @@ -3162,7 +3162,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_set_user_attr(sysdb, domain, name, update_attrs, LDB_FLAG_MOD_REPLACE); if (ret) { - DEBUG(1, ("Failed to update Login attempt information!\n")); + DEBUG(1, "Failed to update Login attempt information!\n"); } done: @@ -3178,7 +3178,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); if (ret) { - DEBUG(2, ("Failed to commit transaction!\n")); + DEBUG(2, "Failed to commit transaction!\n"); } } if (authentication_successful) { @@ -3212,7 +3212,7 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(0, ("Failed to start update transaction\n")); + DEBUG(0, "Failed to start update transaction\n"); goto done; } @@ -3224,8 +3224,8 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_add_group_member(sysdb, domain, add_groups[i], member, type, is_dn); if (ret != EOK) { - DEBUG(1, ("Could not add member [%s] to group [%s]. " - "Skipping.\n", member, add_groups[i])); + DEBUG(1, "Could not add member [%s] to group [%s]. " + "Skipping.\n", member, add_groups[i]); /* Continue on, we should try to finish the rest */ } } @@ -3237,8 +3237,8 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_remove_group_member(sysdb, domain, del_groups[i], member, type, is_dn); if (ret != EOK) { - DEBUG(1, ("Could not remove member [%s] from group [%s]. " - "Skipping\n", member, del_groups[i])); + DEBUG(1, "Could not remove member [%s] from group [%s]. " + "Skipping\n", member, del_groups[i]); /* Continue on, we should try to finish the rest */ } } @@ -3246,7 +3246,7 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -3256,7 +3256,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -3325,7 +3325,7 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -3336,8 +3336,8 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, if (strcasecmp(remove_attrs[i], SYSDB_MEMBEROF) == 0) { continue; } - DEBUG(8, ("Removing attribute [%s] from [%s]\n", - remove_attrs[i], name)); + DEBUG(8, "Removing attribute [%s] from [%s]\n", + remove_attrs[i], name); lret = ldb_msg_add_empty(msg, remove_attrs[i], LDB_FLAG_MOD_DELETE, NULL); if (lret != LDB_SUCCESS) { @@ -3362,7 +3362,7 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -3373,7 +3373,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(msg); @@ -3401,7 +3401,7 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, domain->name); if (basedn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_new_fmt failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_new_fmt failed.\n"); ret = ENOMEM; goto done; } @@ -3410,13 +3410,13 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, basedn, LDB_SCOPE_SUBTREE, attrs?attrs:def_attrs, SYSDB_SID_FILTER, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_search failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_search failed.\n"); goto done; } if (res->count > 1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Search for SID [%s] returned more than " \ - "one object.\n", sid_str)); + DEBUG(SSSDBG_CRIT_FAILURE, "Search for SID [%s] returned more than " \ + "one object.\n", sid_str); ret = EINVAL; goto done; } @@ -3425,9 +3425,9 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry.\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c index 5b444eac6..19597ec50 100644 --- a/src/db/sysdb_ranges.c +++ b/src/db/sysdb_ranges.c @@ -92,8 +92,8 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, } tmp_str = ldb_msg_find_attr_as_string(res->msgs[c], SYSDB_NAME, NULL); if (tmp_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("The object [%s] doesn't have a name.\n", - ldb_dn_get_linearized(res->msgs[c]->dn))); + DEBUG(SSSDBG_MINOR_FAILURE, "The object [%s] doesn't have a name.\n", + ldb_dn_get_linearized(res->msgs[c]->dn)); ret = EINVAL; goto done; } @@ -117,28 +117,28 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_BASE_ID, &list[c]->base_id); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; } ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_ID_RANGE_SIZE, &list[c]->id_range_size); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; } ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_BASE_RID, &list[c]->base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; } ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_SECONDARY_BASE_RID, &list[c]->secondary_base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; } @@ -174,9 +174,9 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range) if ((range->trusted_dom_sid == NULL && range->secondary_base_rid == 0) || (range->trusted_dom_sid != NULL && range->secondary_base_rid != 0)) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid range, skipping. Expected that " + DEBUG(SSSDBG_OP_FAILURE, "Invalid range, skipping. Expected that " "either the secondary base RID or the SID of the trusted " - "domain is set, but not both or none of them.\n")); + "domain is set, but not both or none of them.\n"); return EOK; } @@ -251,7 +251,7 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range) done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -281,20 +281,20 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, ret = sysdb_get_ranges(tmp_ctx, sysdb, &cur_range_count, &cur_ranges); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_ranges failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_ranges failed.\n"); goto done; } keep_range = talloc_zero_array(tmp_ctx, bool, cur_range_count); if (keep_range == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero_array failed.\n"); goto done; } ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_transaction_start failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_transaction_start failed.\n"); goto done; } in_transaction = true; @@ -313,10 +313,10 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, } if (d == cur_range_count) { - DEBUG(SSSDBG_TRACE_FUNC, ("Adding range [%s].\n", ranges[c]->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding range [%s].\n", ranges[c]->name); ret = sysdb_range_create(sysdb, ranges[c]); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_range_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_range_create failed.\n"); goto done; } } @@ -328,8 +328,8 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, */ for (d = 0; d < cur_range_count; d++) { if (!keep_range[d]) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removing range [%s].\n", - cur_ranges[d]->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Removing range [%s].\n", + cur_ranges[d]->name); dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE, cur_ranges[d]->name); if (dn == NULL) { @@ -339,7 +339,7 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, ret = sysdb_delete_entry(sysdb, dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_entry failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_entry failed.\n"); goto done; } } @@ -347,7 +347,7 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not commit transaction\n"); goto done; } in_transaction = false; @@ -356,7 +356,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c index 308710a2c..33ea5325b 100644 --- a/src/db/sysdb_search.c +++ b/src/db/sysdb_search.c @@ -397,8 +397,8 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx, ret = sysdb_getpwnam(tmp_ctx, sysdb, domain, name, &res); if (ret != EOK) { - DEBUG(1, ("sysdb_getpwnam failed: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_getpwnam failed: [%d][%s]\n", + ret, strerror(ret)); goto done; } @@ -410,7 +410,7 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx, } else if (res->count != 1) { ret = EIO; - DEBUG(1, ("sysdb_getpwnam returned count: [%d]\n", res->count)); + DEBUG(1, "sysdb_getpwnam returned count: [%d]\n", res->count); goto done; } @@ -736,9 +736,9 @@ errno_t sysdb_netgr_to_entries(TALLOC_CTX *mem_ctx, &tmp_entry[c]->value.triple.domainname); if (ret != EOK) { DEBUG(SSSDBG_IMPORTANT_INFO, - ("Cannot split netgroup triple [%s], " + "Cannot split netgroup triple [%s], " "this attribute will be skipped \n", - triple_str)); + triple_str); continue; } @@ -920,7 +920,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, } else if (mtype == SYSDB_MEMBER_GROUP) { dn = sysdb_group_strdn(tmp_ctx, dom->name, name); } else { - DEBUG(1, ("Unknown member type\n")); + DEBUG(1, "Unknown member type\n"); ret = EINVAL; goto done; } @@ -950,7 +950,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, goto done; } - DEBUG(8, ("searching sysdb with filter [%s]\n", member_filter)); + DEBUG(8, "searching sysdb with filter [%s]\n", member_filter); ret = sysdb_search_entry(tmp_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, member_filter, group_attrs, @@ -958,8 +958,8 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, if (ret == ENOENT) { direct_sysdb_count = 0; } else if (ret != EOK && ret != ENOENT) { - DEBUG(2, ("sysdb_search_entry failed: [%d]: %s\n", - ret, strerror(ret))); + DEBUG(2, "sysdb_search_entry failed: [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -982,7 +982,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, direct_parents[pi] = talloc_strdup(direct_parents, tmp_str); if (!direct_parents[pi]) { - DEBUG(1, ("A group with no name?\n")); + DEBUG(1, "A group with no name?\n"); ret = EIO; goto done; } @@ -990,8 +990,8 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, } direct_parents[pi] = NULL; - DEBUG(SSSDBG_TRACE_LIBS, ("%s is a member of %zu sysdb groups\n", - name, direct_sysdb_count)); + DEBUG(SSSDBG_TRACE_LIBS, "%s is a member of %zu sysdb groups\n", + name, direct_sysdb_count); *_direct_parents = talloc_steal(mem_ctx, direct_parents); ret = EOK; done: diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c index 80cfe5390..f9cbf4eac 100644 --- a/src/db/sysdb_selinux.c +++ b/src/db/sysdb_selinux.c @@ -49,8 +49,8 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, objectclass); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n", + ret, strerror(ret)); return ret; } @@ -70,7 +70,7 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb, done: if (ret) { - DEBUG(SSSDBG_TRACE_LIBS, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_LIBS, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -120,7 +120,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb, } if (type != SELINUX_CONFIG && type != SELINUX_USER_MAP) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Bad SELinux entity type: [%d]\n", type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Bad SELinux entity type: [%d]\n", type); ret = EINVAL; goto done; } @@ -132,7 +132,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -154,7 +154,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); 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; @@ -163,12 +163,12 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -195,7 +195,7 @@ errno_t sysdb_store_selinux_config(struct sysdb_ctx *sysdb, } if (!order) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The SELinux order is missing\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The SELinux order is missing\n"); return EINVAL; } @@ -232,7 +232,7 @@ errno_t sysdb_delete_usermaps(struct sysdb_ctx *sysdb, ret = sysdb_delete_recursive(sysdb, dn, true); talloc_free(dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_delete_recursive failed.\n"); return ret; } @@ -288,10 +288,10 @@ errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -373,9 +373,9 @@ errno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx, done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No SELinux root entry found\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No SELinux root entry found\n"); } else if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c index b8ac9ef7d..19351a225 100644 --- a/src/db/sysdb_services.c +++ b/src/db/sysdb_services.c @@ -188,7 +188,7 @@ sysdb_store_service(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -212,16 +212,16 @@ sysdb_store_service(struct sysdb_ctx *sysdb, */ for (i = 0; i < res->count; i++) { DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt cache entry [%s] detected. Deleting\n", + "Corrupt cache entry [%s] detected. Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete corrupt cache entry [%s]\n", + "Could not delete corrupt cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; } } @@ -236,7 +236,7 @@ sysdb_store_service(struct sysdb_ctx *sysdb, if (!name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("A service with no name?\n")); + "A service with no name?\n"); /* Corrupted */ } @@ -245,17 +245,17 @@ sysdb_store_service(struct sysdb_ctx *sysdb, * for port reassignments, we need to delete the old entry. */ DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt or replaced cache entry [%s] detected. " + "Corrupt or replaced cache entry [%s] detected. " "Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[0]->dn))); + res->msgs[0]->dn)); ret = sysdb_delete_entry(sysdb, res->msgs[0]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[0]->dn))); + res->msgs[0]->dn)); } } } @@ -282,18 +282,18 @@ sysdb_store_service(struct sysdb_ctx *sysdb, /* Corrupted */ DEBUG(SSSDBG_CRIT_FAILURE, - ("A service with no name?\n")); + "A service with no name?\n"); DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt cache entry [%s] detected. Deleting\n", + "Corrupt cache entry [%s] detected. Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete corrupt cache entry [%s]\n", + "Could not delete corrupt cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; } } else if (strcmp(name, primary_name) == 0) { @@ -303,17 +303,17 @@ sysdb_store_service(struct sysdb_ctx *sysdb, */ if(update_dn) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Two existing services with the same name: [%s]? " + "Two existing services with the same name: [%s]? " "Deleting both.\n", - primary_name)); + primary_name); /* Delete the entry from the previous pass */ ret = sysdb_delete_entry(sysdb, update_dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - update_dn))); + update_dn)); goto done; } @@ -321,9 +321,9 @@ sysdb_store_service(struct sysdb_ctx *sysdb, ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; } @@ -384,15 +384,15 @@ sysdb_store_service(struct sysdb_ctx *sysdb, remove_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not remove missing attributes: [%s]\n", - strerror(ret))); + "Could not remove missing attributes: [%s]\n", + strerror(ret)); goto done; } } ret = sysdb_transaction_commit(sysdb); 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; @@ -401,7 +401,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -523,7 +523,7 @@ sysdb_svc_add(TALLOC_CTX *mem_ctx, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -596,7 +596,7 @@ sysdb_svc_update(struct sysdb_ctx *sysdb, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(msg); return ret; @@ -629,7 +629,7 @@ sysdb_svc_remove_alias(struct sysdb_ctx *sysdb, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -655,7 +655,7 @@ sysdb_svc_delete(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -690,7 +690,7 @@ sysdb_svc_delete(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); 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; @@ -700,13 +700,13 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction\n")); + "Could not cancel transaction\n"); } } if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -800,20 +800,20 @@ errno_t sysdb_search_services(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_SVC_BASE, domain->name); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = ENOMEM; goto fail; } filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_SC, sub_filter); if (!filter) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto fail; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search services with filter: %s\n", filter)); + "Search services with filter: %s\n", filter); ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -827,10 +827,10 @@ errno_t sysdb_search_services(TALLOC_CTX *mem_ctx, fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; diff --git a/src/db/sysdb_ssh.c b/src/db/sysdb_ssh.c index 469425f68..1e436d77e 100644 --- a/src/db/sysdb_ssh.c +++ b/src/db/sysdb_ssh.c @@ -34,7 +34,7 @@ sysdb_update_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_store_custom(sysdb, domain, name, SSH_HOSTS_SUBDIR, attrs); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error storing host %s [%d]: %s\n", name, ret, strerror(ret))); + "Error storing host %s [%d]: %s\n", name, ret, strerror(ret)); return ret; } @@ -58,7 +58,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, struct ldb_message_element *el; unsigned int i; - DEBUG(SSSDBG_TRACE_FUNC, ("Storing host %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing host %s\n", name); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -67,7 +67,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -81,14 +81,14 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_SSH_HOST_OC); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set object class [%d]: %s\n", ret, strerror(ret))); + "Could not set object class [%d]: %s\n", ret, strerror(ret)); goto done; } ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set name attribute [%d]: %s\n", ret, strerror(ret))); + "Could not set name attribute [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -109,8 +109,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, SYSDB_NAME_ALIAS, &el->values[i]); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not add name alias %s [%d]: %s\n", - el->values[i].data, ret, strerror(ret))); + "Could not add name alias %s [%d]: %s\n", + el->values[i].data, ret, strerror(ret)); goto done; } } @@ -122,8 +122,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, alias); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not add name alias %s [%d]: %s\n", - alias, ret, strerror(ret))); + "Could not add name alias %s [%d]: %s\n", + alias, ret, strerror(ret)); goto done; } } @@ -134,8 +134,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_get_el(attrs, SYSDB_SSH_PUBKEY, &el); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get sysdb sshPublicKey [%d]: %s\n", - ret, strerror(ret))); + "Could not get sysdb sshPublicKey [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -143,8 +143,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_time_t(attrs, SYSDB_LAST_UPDATE, now); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set sysdb lastUpdate [%d]: %s\n", - ret, strerror(ret))); + "Could not set sysdb lastUpdate [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -155,7 +155,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -167,7 +167,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } @@ -188,7 +188,7 @@ sysdb_update_ssh_known_host_expire(struct sysdb_ctx *sysdb, struct sysdb_attrs *attrs; DEBUG(SSSDBG_TRACE_FUNC, - ("Updating known_hosts expire time of host %s\n", name)); + "Updating known_hosts expire time of host %s\n", name); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -205,8 +205,8 @@ sysdb_update_ssh_known_host_expire(struct sysdb_ctx *sysdb, now + known_hosts_timeout); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set known_hosts expire time [%d]: %s\n", - ret, strerror(ret))); + "Could not set known_hosts expire time [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -228,7 +228,7 @@ sysdb_delete_ssh_host(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting host %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting host %s\n", name); return sysdb_delete_custom(sysdb, domain, name, SSH_HOSTS_SUBDIR); } @@ -256,11 +256,11 @@ sysdb_search_ssh_hosts(TALLOC_CTX *mem_ctx, &num_results, &results); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up host [%d]: %s\n", - ret, strerror(ret))); + "Error looking up host [%d]: %s\n", + ret, strerror(ret)); goto done; } if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such host\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such host\n"); *hosts = NULL; *num_hosts = 0; goto done; @@ -310,7 +310,7 @@ sysdb_get_ssh_host(TALLOC_CTX *mem_ctx, if (num_hosts > 1) { ret = EINVAL; DEBUG(SSSDBG_CRIT_FAILURE, - ("Found more than one host with name %s\n", name)); + "Found more than one host with name %s\n", name); goto done; } diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 9c2926c00..e0ad22fd8 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -82,8 +82,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) name = ldb_msg_find_attr_as_string(res->msgs[i], "cn", NULL); if (name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EINVAL; goto done; } @@ -113,8 +113,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) /* in theory these may change, but it should never happen */ if (strcasecmp(dom->realm, realm) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Realm name changed from [%s] to [%s]!\n", - dom->realm, realm)); + "Realm name changed from [%s] to [%s]!\n", + dom->realm, realm); talloc_zfree(dom->realm); dom->realm = talloc_strdup(dom, realm); if (dom->realm == NULL) { @@ -124,8 +124,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->flat_name, flat) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Flat name changed from [%s] to [%s]!\n", - dom->flat_name, flat)); + "Flat name changed from [%s] to [%s]!\n", + dom->flat_name, flat); talloc_zfree(dom->flat_name); dom->flat_name = talloc_strdup(dom, flat); if (dom->flat_name == NULL) { @@ -135,8 +135,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->domain_id, id) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Domain changed from [%s] to [%s]!\n", - dom->domain_id, id)); + "Domain changed from [%s] to [%s]!\n", + dom->domain_id, id); talloc_zfree(dom->domain_id); dom->domain_id = talloc_strdup(dom, id); if (dom->domain_id == NULL) { @@ -147,17 +147,17 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) if (dom->mpg != mpg) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->mpg ? "true" : "false", - mpg ? "true" : "false")); + mpg ? "true" : "false"); dom->mpg = mpg; } if (dom->enumerate != enumerate) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->enumerate ? "true" : "false", - enumerate ? "true" : "false")); + enumerate ? "true" : "false"); dom->enumerate = enumerate; } @@ -165,8 +165,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) || (dom->forest != NULL && forest != NULL && strcasecmp(dom->forest, forest) != 0)) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Forest changed from [%s] to [%s]!\n", - dom->forest, forest)); + "Forest changed from [%s] to [%s]!\n", + dom->forest, forest); talloc_zfree(dom->forest); dom->forest = talloc_strdup(dom, forest); if (dom->forest == NULL) { @@ -235,8 +235,8 @@ errno_t sysdb_master_domain_update(struct sss_domain_info *domain) } if (res->count > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Base search returned [%d] results, " - "expected 1.\n", res->count)); + DEBUG(SSSDBG_OP_FAILURE, "Base search returned [%d] results, " + "expected 1.\n", res->count); ret = EINVAL; goto done; } @@ -385,9 +385,9 @@ errno_t sysdb_master_domain_add_info(struct sss_domain_info *domain, ret = ldb_modify(domain->sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", domain->name, ret, - ldb_errstring(domain->sysdb->ldb))); + ldb_errstring(domain->sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -624,9 +624,9 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb, ret = ldb_modify(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", name, ret, - ldb_errstring(sysdb->ldb))); + ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -651,7 +651,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name) goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Removing sub-domain [%s] from db.\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Removing sub-domain [%s] from db.\n", name); dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, name); if (dn == NULL) { ret = ENOMEM; @@ -660,7 +660,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name) ret = sysdb_delete_recursive(sysdb, dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_recursive failed.\n"); goto done; } diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c index ceaecbd26..6e8e78e37 100644 --- a/src/db/sysdb_sudo.c +++ b/src/db/sysdb_sudo.c @@ -112,8 +112,8 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, for (i=0; values[i] ; i++) { ret = sysdb_sudo_convert_time(values[i], &converted); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Invalid time format in rule [%s]!\n", - name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Invalid time format in rule [%s]!\n", + name); goto done; } @@ -135,8 +135,8 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, for (i=0; values[i] ; i++) { ret = sysdb_sudo_convert_time(values[i], &converted); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Invalid time format in rule [%s]!\n", - name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Invalid time format in rule [%s]!\n", + name); goto done; } @@ -157,11 +157,11 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, } if (*result) { - DEBUG(SSSDBG_TRACE_ALL, ("Rule [%s] matches time restrictions\n", - name)); + DEBUG(SSSDBG_TRACE_ALL, "Rule [%s] matches time restrictions\n", + name); } else { - DEBUG(SSSDBG_TRACE_ALL, ("Rule [%s] does not match time " - "restrictions\n", name)); + DEBUG(SSSDBG_TRACE_ALL, "Rule [%s] does not match time " + "restrictions\n", name); } ret = EOK; @@ -333,14 +333,14 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, username, attrs, &msg); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up user %s\n", username)); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up user %s\n", username); goto done; } if (_uid != NULL) { uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (!uid) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no UID?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no UID?\n"); ret = EIO; goto done; } @@ -397,8 +397,8 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, sysdb_groupnames[num_groups] = NULL; } else if (ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up group [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up group [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -425,27 +425,27 @@ sysdb_save_sudorule(struct sysdb_ctx *sysdb, { errno_t ret; - DEBUG(SSSDBG_TRACE_FUNC, ("Adding sudo rule %s\n", rule_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding sudo rule %s\n", rule_name); ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_SUDO_CACHE_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set rule object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set rule object class [%d]: %s\n", + ret, strerror(ret)); return ret; } ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, rule_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); return ret; } ret = sysdb_store_custom(sysdb, domain, rule_name, SUDORULE_SUBDIR, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_custom failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n", + ret, strerror(ret)); return ret; } @@ -499,7 +499,7 @@ static errno_t sysdb_sudo_set_refresh_time(struct sysdb_ctx *sysdb, } } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } else { @@ -571,7 +571,7 @@ static errno_t sysdb_sudo_get_refresh_time(struct sysdb_ctx *sysdb, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } @@ -618,7 +618,7 @@ static errno_t sysdb_sudo_purge_all(struct sysdb_ctx *sysdb, ret = sysdb_delete_recursive(sysdb, base_dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_recursive failed.\n"); goto done; } @@ -632,7 +632,7 @@ errno_t sysdb_sudo_purge_byname(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Deleting sudo rule %s\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Deleting sudo rule %s\n", name); return sysdb_delete_custom(sysdb, domain, name, SUDORULE_SUBDIR); } @@ -666,17 +666,17 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, SUDORULE_SUBDIR, attrs, &count, &msgs); if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No rules matched\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No rules matched\n"); ret = EOK; goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up SUDO rules")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up SUDO rules"); goto done; } ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -684,21 +684,21 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("A rule without a name?\n")); + DEBUG(SSSDBG_OP_FAILURE, "A rule without a name?\n"); /* skip this one but still delete other entries */ continue; } ret = sysdb_sudo_purge_byname(sysdb, domain, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete rule %s\n", name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete rule %s\n", name); goto done; } } ret = sysdb_transaction_commit(sysdb); 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; @@ -707,7 +707,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c index 3c23babe3..b7bdc17cf 100644 --- a/src/db/sysdb_upgrade.c +++ b/src/db/sysdb_upgrade.c @@ -37,7 +37,7 @@ static errno_t commence_upgrade(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct upgrade_ctx *ctx; int ret; - DEBUG(SSSDBG_CRIT_FAILURE, ("UPGRADING DB TO VERSION %s\n", new_ver)); + DEBUG(SSSDBG_CRIT_FAILURE, "UPGRADING DB TO VERSION %s\n", new_ver); ctx = talloc(mem_ctx, struct upgrade_ctx); if (!ctx) { @@ -121,8 +121,8 @@ static int finish_upgrade(int ret, struct upgrade_ctx **ctx, const char **ver) lret = ldb_transaction_cancel((*ctx)->ldb); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction! [%s]\n", - ldb_strerror(lret))); + "Could not cancel transaction! [%s]\n", + ldb_strerror(lret)); /* Do not overwrite ret here, we want to return * the original failure, not the failure of the * transaction cancellation. @@ -185,8 +185,8 @@ int sysdb_upgrade_01(struct ldb_context *ldb, const char **ver) for (i = 0; i < res->count; i++) { el = ldb_msg_find_element(res->msgs[i], "memberUid"); if (!el) { - DEBUG(1, ("memberUid is missing from message [%s], skipping\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + DEBUG(1, "memberUid is missing from message [%s], skipping\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); continue; } @@ -290,7 +290,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); return ret; } @@ -333,7 +333,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, goto exit; } - DEBUG(4, ("Upgrading DB from version: %s\n", version)); + DEBUG(4, "Upgrading DB from version: %s\n", version); if (strcmp(version, SYSDB_VERSION_0_1) == 0) { /* convert database */ @@ -358,7 +358,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, /* == V2->V3 UPGRADE == */ - DEBUG(0, ("UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3)); + DEBUG(0, "UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3); /* ldb uses posix locks, * posix is stupid and kills all locks when you close *any* file @@ -379,14 +379,14 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, /* reopen */ ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); return ret; } /* open a transaction */ ret = ldb_transaction_start(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); ret = EIO; goto exit; } @@ -413,7 +413,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, ret = ldb_transaction_start(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); ret = EIO; goto done; } @@ -477,18 +477,18 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("WARNING: Could not add entry %s," + DEBUG(0, "WARNING: Could not add entry %s," " to new ldb file! (%d [%s])\n", ldb_dn_get_linearized(msg->dn), - ret, ldb_errstring(sysdb->ldb))); + ret, ldb_errstring(sysdb->ldb)); } ret = ldb_delete(ldb, orig_dn); if (ret != LDB_SUCCESS) { - DEBUG(0, ("WARNING: Could not remove entry %s," + DEBUG(0, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(orig_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } } @@ -497,29 +497,29 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, * of failure just for tracing */ ret = ldb_delete(ldb, groups_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(groups_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } ret = ldb_delete(ldb, users_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(users_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } ret = ldb_delete(ldb, domain_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(domain_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } ret = ldb_transaction_commit(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); ret = EIO; goto done; } @@ -562,7 +562,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, ret = ldb_transaction_commit(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); ret = EIO; goto exit; } @@ -574,12 +574,12 @@ done: if (ctx_trans) { ret = ldb_transaction_cancel(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } } ret = ldb_transaction_cancel(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } } @@ -1060,8 +1060,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("User [%s] is a member of %d groups\n", - name, memberof_el->num_values)); + DEBUG(SSSDBG_TRACE_LIBS, "User [%s] is a member of %d groups\n", + name, memberof_el->num_values); for (j = 0; j < memberof_el->num_values; j++) { msg = ldb_msg_new(tmp_ctx); @@ -1077,9 +1077,9 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, } if (!ldb_dn_validate(msg->dn)) { - DEBUG(SSSDBG_MINOR_FAILURE, ("DN validation failed during " + DEBUG(SSSDBG_MINOR_FAILURE, "DN validation failed during " "upgrade: [%s]\n", - memberof_el->values[j].data)); + memberof_el->values[j].data); talloc_zfree(msg); continue; } @@ -1095,8 +1095,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Adding ghost [%s] to entry [%s]\n", - name, ldb_dn_get_linearized(msg->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Adding ghost [%s] to entry [%s]\n", + name, ldb_dn_get_linearized(msg->dn)); ret = sss_ldb_modify_permissive(sysdb->ldb, msg); talloc_zfree(msg); @@ -1140,8 +1140,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, } } - DEBUG(SSSDBG_TRACE_FUNC, ("Removing fake user [%s]\n", - ldb_dn_get_linearized(user->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Removing fake user [%s]\n", + ldb_dn_get_linearized(user->dn)); ret = ldb_delete(sysdb->ldb, user->dn); if (ret != LDB_SUCCESS) { @@ -1203,7 +1203,7 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Found %d autofs entries\n", res->count)); + DEBUG(SSSDBG_TRACE_LIBS, "Found %d autofs entries\n", res->count); for (i = 0; i < res->count; i++) { entry = res->msgs[i]; @@ -1218,13 +1218,13 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, memberof_dn = ldb_dn_from_ldb_val(tmp_ctx, sysdb->ldb, &(memberof_el->values[j])); if (!memberof_dn) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot convert memberof into DN, skipping\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot convert memberof into DN, skipping\n"); continue; } val = ldb_dn_get_rdn_val(memberof_dn); if (!val) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get map name from map DN\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get map name from map DN\n"); continue; } @@ -1233,8 +1233,8 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, key, value, NULL); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs entry [%s]-[%s] into map %s\n", - key, value, val->data)); + "Cannot save autofs entry [%s]-[%s] into map %s\n", + key, value, val->data); continue; } } @@ -1242,13 +1242,13 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, } /* Delete the old entry if it was either processed or incomplete */ - DEBUG(SSSDBG_TRACE_LIBS, ("Deleting [%s]\n", - ldb_dn_get_linearized(entry->dn))); + DEBUG(SSSDBG_TRACE_LIBS, "Deleting [%s]\n", + ldb_dn_get_linearized(entry->dn)); ret = ldb_delete(sysdb->ldb, entry->dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot delete old autofs entry %s\n", - ldb_dn_get_linearized(entry->dn))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot delete old autofs entry %s\n", + ldb_dn_get_linearized(entry->dn)); continue; } } @@ -1337,7 +1337,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) basedn = ldb_dn_new(ctx, sysdb->ldb, SYSDB_BASE); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = EIO; goto done; } @@ -1346,7 +1346,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_ONELEVEL, attrs, "objectclass=%s", SYSDB_SUBDOMAIN_CLASS); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to search subdomains\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to search subdomains\n"); ret = EIO; goto done; } @@ -1356,15 +1356,15 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) tmp_str = ldb_msg_find_attr_as_string(dom_res->msgs[i], "cn", NULL); if (tmp_str == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(dom_res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(dom_res->msgs[i]->dn)); continue; } basedn = ldb_dn_new_fmt(ctx, sysdb->ldb, SYSDB_DOM_BASE, tmp_str); if (!basedn) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to build base dn for subdomain %s\n", tmp_str)); + "Failed to build base dn for subdomain %s\n", tmp_str); continue; } @@ -1372,7 +1372,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_SUBTREE, attrs, NULL); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to search subdomain %s\n", tmp_str)); + "Failed to search subdomain %s\n", tmp_str); talloc_free(basedn); continue; } @@ -1387,8 +1387,8 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) ret = ldb_delete(sysdb->ldb, res->msgs[j]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[j]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[j]->dn)); continue; } } @@ -1426,7 +1426,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) basedn = ldb_dn_new(ctx, sysdb->ldb, SYSDB_BASE); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = EIO; goto done; } @@ -1451,8 +1451,8 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to upgrade DB (%d, [%s])!\n", - ret, ldb_errstring(sysdb->ldb))); + "Failed to upgrade DB (%d, [%s])!\n", + ret, ldb_errstring(sysdb->ldb)); ret = EIO; goto done; } @@ -1462,7 +1462,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_SUBTREE, attrs, "objectclass=%s", SYSDB_ID_RANGE_CLASS); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to search range objects\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to search range objects\n"); ret = EIO; goto done; } @@ -1474,13 +1474,13 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) tmp_str = ldb_msg_find_attr_as_string(res->msgs[i], SYSDB_NAME, NULL); if (tmp_str == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EIO; goto done; } @@ -1490,22 +1490,22 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) newdn = ldb_dn_new_fmt(ctx, sysdb->ldb, SYSDB_TMPL_RANGE, tmp_str); if (!newdn) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to create new DN to move [%s]\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to create new DN to move [%s]\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = ENOMEM; goto done; } ret = ldb_rename(sysdb->ldb, res->msgs[i]->dn, newdn); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to move [%s] to [%s]\n", + "Failed to move [%s] to [%s]\n", ldb_dn_get_linearized(res->msgs[i]->dn), - ldb_dn_get_linearized(newdn))); + ldb_dn_get_linearized(newdn)); ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EIO; goto done; } |