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/providers/ipa/ipa_hbac_users.c | |
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/providers/ipa/ipa_hbac_users.c')
-rw-r--r-- | src/providers/ipa/ipa_hbac_users.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/providers/ipa/ipa_hbac_users.c b/src/providers/ipa/ipa_hbac_users.c index cd56e1913..1ca00d5c3 100644 --- a/src/providers/ipa/ipa_hbac_users.c +++ b/src/providers/ipa/ipa_hbac_users.c @@ -172,12 +172,12 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, goto done; } - DEBUG(7, ("Processing users for rule [%s]\n", rule_name)); + DEBUG(7, "Processing users for rule [%s]\n", rule_name); ret = hbac_get_category(rule_attrs, IPA_USER_CATEGORY, &new_users->category); if (ret != EOK) { - DEBUG(1, ("Could not identify user categories\n")); + DEBUG(1, "Could not identify user categories\n"); goto done; } if (new_users->category & HBAC_CATEGORY_ALL) { @@ -188,12 +188,12 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_el(rule_attrs, IPA_MEMBER_USER, &el); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_attrs_get_el failed.\n")); + DEBUG(1, "sysdb_attrs_get_el failed.\n"); goto done; } if (ret == ENOENT || el->num_values == 0) { el->num_values = 0; - DEBUG(4, ("No user specified, rule will never apply.\n")); + DEBUG(4, "No user specified, rule will never apply.\n"); } new_users->names = talloc_array(new_users, @@ -234,7 +234,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple users. Skipping \n")); + DEBUG(1, "Original DN matched multiple users. Skipping \n"); talloc_zfree(member_dn); continue; } @@ -242,7 +242,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single user. Get the username */ name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -253,8 +253,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added user [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added user [%s] to rule [%s]\n", + name, rule_name); num_users++; } else { /* Check if it is a group instead */ @@ -267,8 +267,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple groups. " - "Skipping\n")); + DEBUG(1, "Original DN matched multiple groups. " + "Skipping\n"); talloc_zfree(member_dn); continue; } @@ -276,7 +276,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single group. Get the groupname */ name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -287,8 +287,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added POSIX group [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added POSIX group [%s] to rule [%s]\n", + name, rule_name); num_groups++; } else { /* If the group still matches the group pattern, @@ -298,13 +298,13 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, member_user, &new_users->groups[num_groups]); if (ret == EOK) { - DEBUG(8, ("Added non-POSIX group [%s] to rule [%s]\n", - new_users->groups[num_groups], rule_name)); + DEBUG(8, "Added non-POSIX group [%s] to rule [%s]\n", + new_users->groups[num_groups], rule_name); num_groups++; } else { /* Not a group, so we don't care about it */ - DEBUG(1, ("[%s] does not map to either a user or group. " - "Skipping\n", member_dn)); + DEBUG(1, "[%s] does not map to either a user or group. " + "Skipping\n", member_dn); } } } |