From a3c8390d19593b1e5277d95bfb4ab206d4785150 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 12 Feb 2014 10:12:04 -0500 Subject: 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 Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/providers/dp_pam_data_util.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/providers/dp_pam_data_util.c') diff --git a/src/providers/dp_pam_data_util.c b/src/providers/dp_pam_data_util.c index 2bc5368f7..8b0ca88aa 100644 --- a/src/providers/dp_pam_data_util.c +++ b/src/providers/dp_pam_data_util.c @@ -65,19 +65,19 @@ struct pam_data *create_pam_data(TALLOC_CTX *mem_ctx) pd = talloc_zero(mem_ctx, struct pam_data); if (pd == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } pd->authtok = sss_authtok_new(pd); if (pd->authtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } pd->newauthtok = sss_authtok_new(pd); if (pd->newauthtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } @@ -174,23 +174,23 @@ errno_t copy_pam_data(TALLOC_CTX *mem_ctx, struct pam_data *src, failed: talloc_free(pd); - DEBUG(1, ("copy_pam_data failed: (%d) %s.\n", ret, strerror(ret))); + DEBUG(1, "copy_pam_data failed: (%d) %s.\n", ret, strerror(ret)); return ret; } void pam_print_data(int l, struct pam_data *pd) { - DEBUG(l, ("command: %s\n", pamcmd2str(pd->cmd))); - DEBUG(l, ("domain: %s\n", PAM_SAFE_ITEM(pd->domain))); - DEBUG(l, ("user: %s\n", PAM_SAFE_ITEM(pd->user))); - DEBUG(l, ("service: %s\n", PAM_SAFE_ITEM(pd->service))); - DEBUG(l, ("tty: %s\n", PAM_SAFE_ITEM(pd->tty))); - DEBUG(l, ("ruser: %s\n", PAM_SAFE_ITEM(pd->ruser))); - DEBUG(l, ("rhost: %s\n", PAM_SAFE_ITEM(pd->rhost))); - DEBUG(l, ("authtok type: %d\n", sss_authtok_get_type(pd->authtok))); - DEBUG(l, ("newauthtok type: %d\n", sss_authtok_get_type(pd->newauthtok))); - DEBUG(l, ("priv: %d\n", pd->priv)); - DEBUG(l, ("cli_pid: %d\n", pd->cli_pid)); + DEBUG(l, "command: %s\n", pamcmd2str(pd->cmd)); + DEBUG(l, "domain: %s\n", PAM_SAFE_ITEM(pd->domain)); + DEBUG(l, "user: %s\n", PAM_SAFE_ITEM(pd->user)); + DEBUG(l, "service: %s\n", PAM_SAFE_ITEM(pd->service)); + DEBUG(l, "tty: %s\n", PAM_SAFE_ITEM(pd->tty)); + DEBUG(l, "ruser: %s\n", PAM_SAFE_ITEM(pd->ruser)); + DEBUG(l, "rhost: %s\n", PAM_SAFE_ITEM(pd->rhost)); + DEBUG(l, "authtok type: %d\n", sss_authtok_get_type(pd->authtok)); + DEBUG(l, "newauthtok type: %d\n", sss_authtok_get_type(pd->newauthtok)); + DEBUG(l, "priv: %d\n", pd->priv); + DEBUG(l, "cli_pid: %d\n", pd->cli_pid); } int pam_add_response(struct pam_data *pd, enum response_type type, -- cgit