summaryrefslogtreecommitdiffstats
path: root/src/util/sss_selinux.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/util/sss_selinux.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/util/sss_selinux.c')
-rw-r--r--src/util/sss_selinux.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/util/sss_selinux.c b/src/util/sss_selinux.c
index f97e3f661..165aeca1b 100644
--- a/src/util/sss_selinux.c
+++ b/src/util/sss_selinux.c
@@ -66,7 +66,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
errno_t ret;
if (usermap == NULL) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("NULL given as usermap! Skipping ...\n"));
+ DEBUG(SSSDBG_MINOR_FAILURE, "NULL given as usermap! Skipping ...\n");
return false;
}
@@ -86,14 +86,14 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
if (user) {
ret = sysdb_attrs_get_el(user, SYSDB_ORIG_DN, &dn);
if (ret != EOK) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("User does not have origDN\n"));
+ DEBUG(SSSDBG_MINOR_FAILURE, "User does not have origDN\n");
return false;
}
ret = sysdb_attrs_get_el(user, SYSDB_ORIG_MEMBEROF, &memberof);
if (ret != EOK) {
DEBUG(SSSDBG_TRACE_ALL,
- ("User does not have orig memberof, "
- "therefore it can't match to any rule\n"));
+ "User does not have orig memberof, "
+ "therefore it can't match to any rule\n");
return false;
}
@@ -113,7 +113,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
if (!matched_category) {
if (users_el == NULL) {
- DEBUG(SSSDBG_TRACE_ALL, ("No users specified in the rule!\n"));
+ DEBUG(SSSDBG_TRACE_ALL, "No users specified in the rule!\n");
return false;
} else {
matched_name = match_entity(users_el, dn);
@@ -123,7 +123,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
} else if (matched_group) {
priority |= SELINUX_PRIORITY_USER_GROUP;
} else {
- DEBUG(SSSDBG_TRACE_ALL, ("User did not match\n"));
+ DEBUG(SSSDBG_TRACE_ALL, "User did not match\n");
return false;
}
}
@@ -135,14 +135,14 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
if (host) {
ret = sysdb_attrs_get_el(host, SYSDB_ORIG_DN, &dn);
if (ret != EOK) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("Host does not have origDN\n"));
+ DEBUG(SSSDBG_MINOR_FAILURE, "Host does not have origDN\n");
return false;
}
ret = sysdb_attrs_get_el(host, SYSDB_ORIG_MEMBEROF, &memberof);
if (ret != EOK) {
DEBUG(SSSDBG_TRACE_ALL,
- ("Host does not have orig memberof, "
- "therefore it can't match to any rule\n"));
+ "Host does not have orig memberof, "
+ "therefore it can't match to any rule\n");
return false;
}
@@ -161,7 +161,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
}
if (!matched_category) {
if (hosts_el == NULL) {
- DEBUG(SSSDBG_TRACE_ALL, ("No users specified in the rule!\n"));
+ DEBUG(SSSDBG_TRACE_ALL, "No users specified in the rule!\n");
return false;
} else {
matched_name = match_entity(hosts_el, dn);
@@ -171,7 +171,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
} else if (matched_group) {
priority |= SELINUX_PRIORITY_HOST_GROUP;
} else {
- DEBUG(SSSDBG_TRACE_ALL, ("Host did not match\n"));
+ DEBUG(SSSDBG_TRACE_ALL, "Host did not match\n");
return false;
}
}
@@ -207,7 +207,7 @@ errno_t sss_selinux_extract_user(TALLOC_CTX *mem_ctx,
attrs = talloc_array(tmp_ctx, const char *, 3);
if (attrs == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_array failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_array failed.\n");
ret = ENOMEM;
goto done;
}
@@ -218,7 +218,7 @@ errno_t sss_selinux_extract_user(TALLOC_CTX *mem_ctx,
ret = sysdb_search_user_by_name(tmp_ctx, domain, username, attrs,
&user_msg);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_name failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed.\n");
goto done;
}