summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_ops.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-02-12 10:12:04 -0500
committerJakub Hrozek <jhrozek@redhat.com>2014-02-12 22:30:55 +0100
commita3c8390d19593b1e5277d95bfb4ab206d4785150 (patch)
tree2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/db/sysdb_ops.c
parentcc026fd9ba386f2197e3217940d597dcad1a26fe (diff)
downloadsssd-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/sysdb_ops.c')
-rw-r--r--src/db/sysdb_ops.c306
1 files changed, 153 insertions, 153 deletions
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);