summaryrefslogtreecommitdiffstats
path: root/src/util/sss_nss.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_nss.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_nss.c')
-rw-r--r--src/util/sss_nss.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/util/sss_nss.c b/src/util/sss_nss.c
index 2b7338329..406c95cd0 100644
--- a/src/util/sss_nss.c
+++ b/src/util/sss_nss.c
@@ -36,7 +36,7 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
const char *orig = NULL;
if (template == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Missing template.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Missing template.\n");
return NULL;
}
@@ -45,13 +45,13 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
copy = talloc_strdup(tmp_ctx, template);
if (copy == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n");
goto done;
}
result = talloc_strdup(tmp_ctx, "");
if (result == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n");
goto done;
}
@@ -60,15 +60,15 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
*n = '\0';
n++;
if ( *n == '\0' ) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("format error, single %% at the end of "
- "the template.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "format error, single %% at the end of "
+ "the template.\n");
goto done;
}
switch( *n ) {
case 'u':
if (username == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand user name template "
- "because user name is empty.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand user name template "
+ "because user name is empty.\n");
goto done;
}
result = talloc_asprintf_append(result, "%s%s", p,
@@ -77,8 +77,8 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'U':
if (uid == 0) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand uid template "
- "because uid is invalid.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand uid template "
+ "because uid is invalid.\n");
goto done;
}
result = talloc_asprintf_append(result, "%s%d", p,
@@ -87,9 +87,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'd':
if (domain == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand domain name "
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name "
"template because domain name "
- "is empty.\n"));
+ "is empty.\n");
goto done;
}
result = talloc_asprintf_append(result, "%s%s", p,
@@ -98,9 +98,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'f':
if (domain == NULL || username == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand fully qualified "
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand fully qualified "
"name template because domain "
- "or user name is empty.\n"));
+ "or user name is empty.\n");
goto done;
}
result = talloc_asprintf_append(result, "%s%s@%s", p,
@@ -110,8 +110,8 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'o':
if (original == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("Original home directory for %s is not available, "
- "using empty string\n", username));
+ "Original home directory for %s is not available, "
+ "using empty string\n", username);
orig = "";
} else {
orig = original;
@@ -121,9 +121,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'F':
if (flatname == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand domain name "
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name "
"template because domain flat "
- "name is empty.\n"));
+ "name is empty.\n");
goto done;
}
result = talloc_asprintf_append(result, "%s%s", p, flatname);
@@ -134,13 +134,13 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("format error, unknown template "
- "[%%%c].\n", *n));
+ DEBUG(SSSDBG_CRIT_FAILURE, "format error, unknown template "
+ "[%%%c].\n", *n);
goto done;
}
if (result == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf_append failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n");
goto done;
}
@@ -149,7 +149,7 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
result = talloc_asprintf_append(result, "%s", p);
if (result == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf_append failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n");
goto done;
}