diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/db | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.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:
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 | 306 | ||||
-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 | 24 | ||||
-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, 484 insertions, 484 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c index 65277af01..901417e81 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); } @@ -665,7 +665,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; } @@ -724,21 +724,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; @@ -812,8 +812,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; } } @@ -826,7 +826,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); } @@ -837,7 +837,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); } @@ -848,7 +848,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); } @@ -909,10 +909,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; } @@ -939,10 +939,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; } @@ -969,10 +969,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; } @@ -1044,11 +1044,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; } @@ -1103,14 +1103,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); @@ -1210,13 +1210,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; } @@ -1227,8 +1227,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; } @@ -1249,7 +1249,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: @@ -1326,7 +1326,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; } } @@ -1334,7 +1334,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; } @@ -1456,7 +1456,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; } @@ -1513,7 +1513,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 { @@ -1640,7 +1640,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) { @@ -1649,26 +1649,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; @@ -1689,7 +1689,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; } @@ -1698,8 +1698,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; @@ -1752,7 +1752,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; @@ -1830,7 +1830,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; } @@ -1875,7 +1875,7 @@ errno_t sysdb_get_real_name(TALLOC_CTX *mem_ctx, ret = sysdb_getpwnam(tmp_ctx, domain, name, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot canonicalize username\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot canonicalize username\n"); goto done; } @@ -1885,14 +1885,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; } @@ -1913,14 +1913,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 d9f5d2564..218e9c0a0 100644 --- a/src/db/sysdb_autofs.c +++ b/src/db/sysdb_autofs.c @@ -106,7 +106,7 @@ sysdb_save_autofsmap(struct sss_domain_info *domain, 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) { @@ -124,29 +124,29 @@ sysdb_save_autofsmap(struct sss_domain_info *domain, 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; } @@ -154,15 +154,15 @@ sysdb_save_autofsmap(struct sss_domain_info *domain, ((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(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; } @@ -176,7 +176,7 @@ errno_t sysdb_delete_autofsmap(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(domain, name, AUTOFS_MAP_SUBDIR); } @@ -205,8 +205,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; } @@ -222,17 +222,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; } @@ -257,7 +257,7 @@ sysdb_save_autofsentry(struct sss_domain_info *domain, 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) { @@ -275,22 +275,22 @@ sysdb_save_autofsentry(struct sss_domain_info *domain, 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; } @@ -302,8 +302,8 @@ sysdb_save_autofsentry(struct sss_domain_info *domain, 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; } @@ -364,7 +364,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) { @@ -387,10 +387,10 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, ret = sysdb_search_entry(tmp_ctx, domain->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; @@ -399,8 +399,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; @@ -467,7 +467,7 @@ sysdb_invalidate_autofs_maps(struct sss_domain_info *domain) &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; @@ -487,7 +487,7 @@ sysdb_invalidate_autofs_maps(struct sss_domain_info *domain) ret = sysdb_transaction_start(domain->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; @@ -495,21 +495,21 @@ sysdb_invalidate_autofs_maps(struct sss_domain_info *domain) 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(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(domain->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; @@ -519,7 +519,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->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 05f9d90e2..7d342671b 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 sss_domain_info *domain, 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, domain->sysdb->ldb, SYSDB_TMPL_IDMAP, clean_sid, domain->name); @@ -82,7 +82,7 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -101,8 +101,8 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, } 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, @@ -169,8 +169,8 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, lret = ldb_add(domain->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; } @@ -186,17 +186,17 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, -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; } @@ -208,8 +208,8 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, 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; } @@ -219,14 +219,14 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, * 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, @@ -247,8 +247,8 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, lret = ldb_modify(domain->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; } @@ -257,7 +257,7 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain, ret = sysdb_transaction_commit(domain->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; @@ -267,7 +267,7 @@ done: sret = sysdb_transaction_cancel(domain->sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction\n")); + "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -289,7 +289,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, domain->sysdb->ldb, SYSDB_TMPL_IDMAP_BASE, domain->name); @@ -302,8 +302,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 cb331e1e2..109105523 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,20 +170,20 @@ int sysdb_delete_recursive(struct sysdb_ctx *sysdb, ret = EOK; } if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Search error: %d (%s)\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "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(SSSDBG_TRACE_ALL, ("Trying to delete [%s].\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(SSSDBG_TRACE_ALL, "Trying to delete [%s].\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = sysdb_delete_entry(sysdb, msgs[i]->dn, false); if (ret) { @@ -281,10 +281,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); @@ -345,10 +345,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; @@ -401,10 +401,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); @@ -460,10 +460,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; @@ -516,10 +516,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); @@ -576,10 +576,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; @@ -631,17 +631,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; @@ -787,7 +787,7 @@ int sysdb_get_new_id(struct sss_domain_info *domain, 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; } @@ -797,8 +797,8 @@ int sysdb_get_new_id(struct sss_domain_info *domain, } 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; } @@ -832,7 +832,7 @@ int sysdb_get_new_id(struct sss_domain_info *domain, SYSDB_GIDNUM, new_id); } if (!filter) { - DEBUG(6, ("Error: Out of memory\n")); + DEBUG(6, "Error: Out of memory\n"); ret = ENOMEM; goto done; } @@ -857,8 +857,8 @@ int sysdb_get_new_id(struct sss_domain_info *domain, /* 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; } @@ -877,7 +877,7 @@ int sysdb_get_new_id(struct sss_domain_info *domain, /* 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; } @@ -902,7 +902,7 @@ done: ldb_transaction_cancel(domain->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; @@ -982,7 +982,7 @@ int sysdb_add_basic_user(struct sss_domain_info *domain, 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; @@ -1191,7 +1191,7 @@ int sysdb_add_user(struct sss_domain_info *domain, 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; @@ -1200,16 +1200,16 @@ int sysdb_add_user(struct sss_domain_info *domain, 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; } @@ -1312,7 +1312,7 @@ done: ret = ldb_transaction_commit(domain->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(domain->sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1364,7 +1364,7 @@ int sysdb_add_basic_group(struct sss_domain_info *domain, 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; @@ -1388,8 +1388,8 @@ int sysdb_add_group(struct sss_domain_info *domain, 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; } @@ -1475,7 +1475,7 @@ done: ret = ldb_transaction_commit(domain->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(domain->sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1537,7 +1537,7 @@ int sysdb_add_incomplete_group(struct sss_domain_info *domain, 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; @@ -1581,7 +1581,7 @@ int sysdb_mod_group_member(struct sss_domain_info *domain, 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; @@ -1629,7 +1629,7 @@ int sysdb_add_basic_netgroup(struct sss_domain_info *domain, 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; @@ -1692,7 +1692,7 @@ int sysdb_add_netgroup(struct sss_domain_info *domain, 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"); } } @@ -1703,7 +1703,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(domain->sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1754,7 +1754,7 @@ int sysdb_store_user(struct sss_domain_info *domain, ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } @@ -1789,8 +1789,8 @@ int sysdb_store_user(struct sss_domain_info *domain, 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(domain, name, uid, gid, gecos, homedir, shell, orig_dn, attrs, cache_timeout, now); } @@ -1799,7 +1799,7 @@ int sysdb_store_user(struct sss_domain_info *domain, 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; } } @@ -1851,14 +1851,14 @@ int sysdb_store_user(struct sss_domain_info *domain, 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(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } @@ -1868,12 +1868,12 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(domain->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; @@ -1944,8 +1944,8 @@ int sysdb_store_group(struct sss_domain_info *domain, 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(domain, name, gid, attrs, cache_timeout, now); } @@ -1970,7 +1970,7 @@ int sysdb_store_group(struct sss_domain_info *domain, 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; @@ -2069,13 +2069,13 @@ int sysdb_cache_password(struct sss_domain_info *domain, 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; } @@ -2105,7 +2105,7 @@ int sysdb_cache_password(struct sss_domain_info *domain, 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; @@ -2130,11 +2130,11 @@ int sysdb_search_custom(TALLOC_CTX *mem_ctx, basedn = sysdb_custom_subtree_dn(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; } @@ -2169,12 +2169,12 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, basedn = sysdb_custom_dn(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; } @@ -2186,7 +2186,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; } @@ -2251,7 +2251,7 @@ int sysdb_store_custom(struct sss_domain_info *domain, msg->dn = sysdb_custom_dn(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; } @@ -2283,14 +2283,14 @@ int sysdb_store_custom(struct sss_domain_info *domain, ret = ldb_modify(domain->sysdb->ldb, msg); } if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to store custom entry: %s(%d)[%s]\n", - ldb_strerror(ret), ret, ldb_errstring(domain->sysdb->ldb))); + DEBUG(1, "Failed to store custom entry: %s(%d)[%s]\n", + ldb_strerror(ret), ret, ldb_errstring(domain->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(domain->sysdb->ldb); } else { ret = ldb_transaction_commit(domain->sysdb->ldb); @@ -2321,7 +2321,7 @@ int sysdb_delete_custom(struct sss_domain_info *domain, dn = sysdb_custom_dn(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; } @@ -2335,8 +2335,8 @@ int sysdb_delete_custom(struct sss_domain_info *domain, break; default: - DEBUG(1, ("LDB Error: %s(%d)\nError Message: [%s]\n", - ldb_strerror(ret), ret, ldb_errstring(domain->sysdb->ldb))); + DEBUG(1, "LDB Error: %s(%d)\nError Message: [%s]\n", + ldb_strerror(ret), ret, ldb_errstring(domain->sysdb->ldb)); ret = sysdb_error_to_errno(ret); break; } @@ -2432,10 +2432,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; @@ -2463,20 +2463,20 @@ int sysdb_search_users(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, domain->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, domain->sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2490,10 +2490,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; @@ -2533,7 +2533,7 @@ int sysdb_delete_user(struct sss_domain_info *domain, 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; } @@ -2596,7 +2596,7 @@ int sysdb_delete_user(struct sss_domain_info *domain, 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; } @@ -2624,20 +2624,20 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, domain->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, domain->sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2651,10 +2651,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; @@ -2691,7 +2691,7 @@ int sysdb_delete_group(struct sss_domain_info *domain, 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; } @@ -2711,7 +2711,7 @@ int sysdb_delete_group(struct sss_domain_info *domain, 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; } @@ -2738,19 +2738,19 @@ int sysdb_search_netgroups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, domain->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, domain->sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2764,9 +2764,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; @@ -2790,11 +2790,11 @@ int sysdb_delete_netgroup(struct sss_domain_info *domain, ret = sysdb_search_netgroup_by_name(tmp_ctx, 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; } @@ -2806,7 +2806,7 @@ int sysdb_delete_netgroup(struct sss_domain_info *domain, 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; @@ -2829,14 +2829,14 @@ int sysdb_delete_by_sid(struct sysdb_ctx *sysdb, ret = sysdb_search_object_by_sid(tmp_ctx, 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; } @@ -2854,7 +2854,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; @@ -2890,8 +2890,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; } @@ -2900,30 +2900,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; } @@ -2963,22 +2963,22 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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 (domain->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; } @@ -2996,8 +2996,8 @@ int sysdb_cache_auth(struct sss_domain_info *domain, ret = sysdb_search_user_by_name(tmp_ctx, 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; } @@ -3010,16 +3010,16 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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; @@ -3031,7 +3031,7 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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; } @@ -3039,28 +3039,28 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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) { @@ -3071,8 +3071,8 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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; } @@ -3080,22 +3080,22 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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; } @@ -3103,7 +3103,7 @@ int sysdb_cache_auth(struct sss_domain_info *domain, 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; } } @@ -3111,7 +3111,7 @@ int sysdb_cache_auth(struct sss_domain_info *domain, ret = sysdb_set_user_attr(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: @@ -3127,7 +3127,7 @@ done: ret = ldb_transaction_commit(domain->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) { @@ -3160,7 +3160,7 @@ static errno_t sysdb_update_members_ex(struct sss_domain_info *domain, ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(0, ("Failed to start update transaction\n")); + DEBUG(0, "Failed to start update transaction\n"); goto done; } @@ -3172,8 +3172,8 @@ static errno_t sysdb_update_members_ex(struct sss_domain_info *domain, ret = sysdb_add_group_member(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 */ } } @@ -3185,8 +3185,8 @@ static errno_t sysdb_update_members_ex(struct sss_domain_info *domain, ret = sysdb_remove_group_member(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 */ } } @@ -3194,7 +3194,7 @@ static errno_t sysdb_update_members_ex(struct sss_domain_info *domain, ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -3204,7 +3204,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->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); @@ -3270,7 +3270,7 @@ errno_t sysdb_remove_attrs(struct sss_domain_info *domain, ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -3281,8 +3281,8 @@ errno_t sysdb_remove_attrs(struct sss_domain_info *domain, 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) { @@ -3307,7 +3307,7 @@ errno_t sysdb_remove_attrs(struct sss_domain_info *domain, ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -3318,7 +3318,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->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); @@ -3345,7 +3345,7 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, domain->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; } @@ -3355,13 +3355,13 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, SYSDB_SID_FILTER, sid_str); if (ret != EOK) { ret = sysdb_error_to_errno(ret); - 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; } @@ -3370,9 +3370,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 d5b7a305f..640cf0be5 100644 --- a/src/db/sysdb_search.c +++ b/src/db/sysdb_search.c @@ -390,8 +390,8 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx, ret = sysdb_getpwnam(tmp_ctx, 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; } @@ -403,7 +403,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; } @@ -728,9 +728,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; } @@ -909,7 +909,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; } @@ -939,7 +939,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, dom->sysdb, basedn, LDB_SCOPE_SUBTREE, member_filter, group_attrs, @@ -947,8 +947,8 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, if (ret == ENOENT) { direct_sysdb_count = 0; } else if (ret != EOK) { - 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; } @@ -971,7 +971,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; } @@ -979,8 +979,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 63e1a3181..2dbbb75b9 100644 --- a/src/db/sysdb_selinux.c +++ b/src/db/sysdb_selinux.c @@ -53,8 +53,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; } @@ -74,7 +74,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; @@ -124,7 +124,7 @@ static errno_t sysdb_store_selinux_entity(struct sss_domain_info *domain, } 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; } @@ -136,7 +136,7 @@ static errno_t sysdb_store_selinux_entity(struct sss_domain_info *domain, 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; } @@ -158,7 +158,7 @@ static errno_t sysdb_store_selinux_entity(struct sss_domain_info *domain, 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; @@ -167,12 +167,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; @@ -197,7 +197,7 @@ errno_t sysdb_store_selinux_config(struct sss_domain_info *domain, } if (!order) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The SELinux order is missing\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The SELinux order is missing\n"); return EINVAL; } @@ -234,7 +234,7 @@ errno_t sysdb_delete_usermaps(struct sss_domain_info *domain) 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; } @@ -317,9 +317,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 089389ff9..5f2315e72 100644 --- a/src/db/sysdb_services.c +++ b/src/db/sysdb_services.c @@ -188,7 +188,7 @@ sysdb_store_service(struct sss_domain_info *domain, 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 sss_domain_info *domain, */ 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 sss_domain_info *domain, 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 sss_domain_info *domain, * 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 sss_domain_info *domain, /* 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 sss_domain_info *domain, */ 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 sss_domain_info *domain, 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 sss_domain_info *domain, 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); @@ -522,7 +522,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; @@ -595,7 +595,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; @@ -628,7 +628,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; @@ -654,7 +654,7 @@ sysdb_svc_delete(struct sss_domain_info *domain, 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; } @@ -689,7 +689,7 @@ sysdb_svc_delete(struct sss_domain_info *domain, 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; @@ -699,13 +699,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; @@ -796,20 +796,20 @@ errno_t sysdb_search_services(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, domain->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, domain->sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -823,10 +823,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 daa4067c7..7dd98cfdb 100644 --- a/src/db/sysdb_ssh.c +++ b/src/db/sysdb_ssh.c @@ -34,7 +34,7 @@ sysdb_update_ssh_host(struct sss_domain_info *domain, 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; } @@ -57,7 +57,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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) { @@ -66,7 +66,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -80,14 +80,14 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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; } @@ -108,8 +108,8 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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; } } @@ -121,8 +121,8 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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; } } @@ -133,8 +133,8 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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; } } @@ -142,8 +142,8 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, 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; } @@ -154,7 +154,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain, ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -166,7 +166,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } @@ -186,7 +186,7 @@ sysdb_update_ssh_known_host_expire(struct sss_domain_info *domain, 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) { @@ -203,8 +203,8 @@ sysdb_update_ssh_known_host_expire(struct sss_domain_info *domain, 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; } @@ -225,7 +225,7 @@ errno_t sysdb_delete_ssh_host(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(domain, name, SSH_HOSTS_SUBDIR); } @@ -252,11 +252,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; @@ -305,7 +305,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 7253a3ab4..003b5709c 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; @@ -332,14 +332,14 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, ret = sysdb_search_user_by_name(tmp_ctx, 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; } @@ -396,8 +396,8 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, 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; } } @@ -423,28 +423,28 @@ sysdb_save_sudorule(struct sss_domain_info *domain, { 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(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; } @@ -498,7 +498,7 @@ static errno_t sysdb_sudo_set_refresh_time(struct sss_domain_info *domain, } } 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 { @@ -569,7 +569,7 @@ static errno_t sysdb_sudo_get_refresh_time(struct sss_domain_info *domain, 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; } @@ -613,7 +613,7 @@ static errno_t sysdb_sudo_purge_all(struct sss_domain_info *domain) ret = sysdb_delete_recursive(domain->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; } @@ -626,7 +626,7 @@ done: errno_t sysdb_sudo_purge_byname(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(domain, name, SUDORULE_SUBDIR); } @@ -659,17 +659,17 @@ errno_t sysdb_sudo_purge_byfilter(struct sss_domain_info *domain, 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(domain->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; @@ -677,21 +677,21 @@ errno_t sysdb_sudo_purge_byfilter(struct sss_domain_info *domain, 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(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(domain->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,7 +700,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->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 377286d98..dc3619986 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; } |