summaryrefslogtreecommitdiffstats
path: root/src/providers/proxy/proxy_netgroup.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/providers/proxy/proxy_netgroup.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/providers/proxy/proxy_netgroup.c')
-rw-r--r--src/providers/proxy/proxy_netgroup.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/providers/proxy/proxy_netgroup.c b/src/providers/proxy/proxy_netgroup.c
index 6be889aa4..c799e284c 100644
--- a/src/providers/proxy/proxy_netgroup.c
+++ b/src/providers/proxy/proxy_netgroup.c
@@ -40,7 +40,7 @@ static errno_t make_netgroup_attr(struct __netgrent netgrent,
ret =sysdb_attrs_add_string(attrs, SYSDB_NETGROUP_MEMBER,
netgrent.val.group);
if (ret != EOK) {
- DEBUG(1, ("sysdb_attrs_add_string failed.\n"));
+ DEBUG(1, "sysdb_attrs_add_string failed.\n");
return ret;
}
} else if (netgrent.type == triple_val) {
@@ -49,17 +49,17 @@ static errno_t make_netgroup_attr(struct __netgrent netgrent,
get_triple_el(netgrent.val.triple.user),
get_triple_el(netgrent.val.triple.domain));
if (dummy == NULL) {
- DEBUG(1, ("talloc_asprintf failed.\n"));
+ DEBUG(1, "talloc_asprintf failed.\n");
return ENOMEM;
}
ret = sysdb_attrs_add_string(attrs, SYSDB_NETGROUP_TRIPLE, dummy);
if (ret != EOK) {
- DEBUG(1, ("sysdb_attrs_add_string failed.\n"));
+ DEBUG(1, "sysdb_attrs_add_string failed.\n");
return ret;
}
} else {
- DEBUG(1, ("Unknown netgrent entry type [%d].\n", netgrent.type));
+ DEBUG(1, "Unknown netgrent entry type [%d].\n", netgrent.type);
return EINVAL;
}
@@ -77,7 +77,7 @@ static errno_t save_netgroup(struct sss_domain_info *domain,
if (lowercase) {
ret = sysdb_attrs_add_lc_name_alias(attrs, name);
if (ret) {
- DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n");
return ret;
}
}
@@ -85,7 +85,7 @@ static errno_t save_netgroup(struct sss_domain_info *domain,
ret = sysdb_add_netgroup(domain, name, NULL, attrs, NULL,
cache_timeout, 0);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("sysdb_add_netgroup failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sysdb_add_netgroup failed.\n");
return ret;
}
@@ -99,27 +99,27 @@ static errno_t handle_error(enum nss_status status,
switch (status) {
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Netgroup lookup succeeded\n"));
+ DEBUG(SSSDBG_TRACE_INTERNAL, "Netgroup lookup succeeded\n");
ret = EOK;
break;
case NSS_STATUS_NOTFOUND:
- DEBUG(SSSDBG_MINOR_FAILURE, ("The netgroup was not found\n"));
+ DEBUG(SSSDBG_MINOR_FAILURE, "The netgroup was not found\n");
ret = sysdb_delete_netgroup(domain, name);
if (ret != EOK) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot delete netgroup: %d\n", ret));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot delete netgroup: %d\n", ret);
ret = EIO;
}
break;
case NSS_STATUS_UNAVAIL:
DEBUG(SSSDBG_TRACE_LIBS,
- ("The proxy target did not respond, going offline\n"));
+ "The proxy target did not respond, going offline\n");
ret = ENXIO;
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Unexpected error looking up netgroup\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Unexpected error looking up netgroup\n");
ret = EIO;
break;
}
@@ -142,21 +142,21 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx,
status = ctx->ops.setnetgrent(name, &result);
if (status != NSS_STATUS_SUCCESS) {
DEBUG(SSSDBG_OP_FAILURE,
- ("setnetgrent failed for netgroup [%s].\n", name));
+ "setnetgrent failed for netgroup [%s].\n", name);
ret = handle_error(status, dom, name);
goto done;
}
tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n");
ret = ENOMEM;
goto done;
}
attrs = sysdb_new_attrs(tmp_ctx);
if (attrs == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_new_attrs failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_new_attrs failed.\n");
ret = ENOMEM;
goto done;
}
@@ -168,15 +168,15 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx,
status != NSS_STATUS_NOTFOUND) {
ret = handle_error(status, dom, name);
DEBUG(SSSDBG_OP_FAILURE,
- ("getnetgrent_r failed for netgroup [%s]: [%d][%s].\n",
- name, ret, strerror(ret)));
+ "getnetgrent_r failed for netgroup [%s]: [%d][%s].\n",
+ name, ret, strerror(ret));
goto done;
}
if (status == NSS_STATUS_SUCCESS) {
ret = make_netgroup_attr(result, attrs);
if (ret != EOK) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("make_netgroup_attr failed.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "make_netgroup_attr failed.\n");
goto done;
}
}
@@ -184,7 +184,7 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx,
status = ctx->ops.endnetgrent(&result);
if (status != NSS_STATUS_SUCCESS) {
- DEBUG(SSSDBG_OP_FAILURE, ("endnetgrent failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "endnetgrent failed.\n");
ret = handle_error(status, dom, name);
goto done;
}
@@ -193,7 +193,7 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx,
!dom->case_sensitive,
dom->netgroup_timeout);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("save_netgroup failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "save_netgroup failed.\n");
goto done;
}