summaryrefslogtreecommitdiffstats
path: root/src/sss_client
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/sss_client
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/sss_client')
-rw-r--r--src/sss_client/ssh/sss_ssh_authorizedkeys.c8
-rw-r--r--src/sss_client/ssh/sss_ssh_knownhostsproxy.c46
2 files changed, 27 insertions, 27 deletions
diff --git a/src/sss_client/ssh/sss_ssh_authorizedkeys.c b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
index bc991a837..89eda2371 100644
--- a/src/sss_client/ssh/sss_ssh_authorizedkeys.c
+++ b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
@@ -53,7 +53,7 @@ int main(int argc, const char **argv)
ret = set_locale();
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("set_locale() failed (%d): %s\n", ret, strerror(ret)));
+ "set_locale() failed (%d): %s\n", ret, strerror(ret));
ERROR("Error setting the locale\n");
ret = EXIT_FAILURE;
goto fini;
@@ -88,7 +88,7 @@ int main(int argc, const char **argv)
pc_user, pc_domain, NULL, &ent);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)));
+ "sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret));
ERROR("Error looking up public keys\n");
ret = EXIT_FAILURE;
goto fini;
@@ -99,8 +99,8 @@ int main(int argc, const char **argv)
ret = sss_ssh_format_pubkey(mem_ctx, &ent->pubkeys[i], &repr);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("sss_ssh_format_pubkey() failed (%d): %s\n",
- ret, strerror(ret)));
+ "sss_ssh_format_pubkey() failed (%d): %s\n",
+ ret, strerror(ret));
continue;
}
diff --git a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
index e2202b183..adb82288d 100644
--- a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
+++ b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
@@ -54,16 +54,16 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
flags = fcntl(0, F_GETFL);
if (flags == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
ret = fcntl(0, F_SETFL, flags | O_NONBLOCK);
if (ret == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
@@ -71,8 +71,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
sock = socket(family, SOCK_STREAM, IPPROTO_TCP);
if (sock == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("socket() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "socket() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
@@ -80,8 +80,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
ret = connect(sock, addr, addr_len);
if (ret == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("connect() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "connect() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
@@ -89,16 +89,16 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
flags = fcntl(sock, F_GETFL);
if (flags == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
ret = fcntl(sock, F_SETFL, flags | O_NONBLOCK);
if (ret == -1) {
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
}
@@ -115,7 +115,7 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
continue;
}
DEBUG(SSSDBG_OP_FAILURE,
- ("poll() failed (%d): %s\n", ret, strerror(ret)));
+ "poll() failed (%d): %s\n", ret, strerror(ret));
goto done;
}
@@ -130,7 +130,7 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
continue;
}
DEBUG(SSSDBG_OP_FAILURE,
- ("read() failed (%d): %s\n", ret, strerror(ret)));
+ "read() failed (%d): %s\n", ret, strerror(ret));
goto done;
} else if (res == 0) {
ret = EOK;
@@ -142,8 +142,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
ret = errno;
if (res == -1) {
DEBUG(SSSDBG_OP_FAILURE,
- ("sss_atomic_write_s() failed (%d): %s\n",
- ret, strerror(ret)));
+ "sss_atomic_write_s() failed (%d): %s\n",
+ ret, strerror(ret));
goto done;
} else if (ret == EPIPE) {
ret = EOK;
@@ -172,8 +172,8 @@ connect_proxy_command(char **args)
execv(args[0], (char * const *)args);
ret = errno;
- DEBUG(SSSDBG_OP_FAILURE, ("execv() failed (%d): %s\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "execv() failed (%d): %s\n",
+ ret, strerror(ret));
return ret;
}
@@ -210,14 +210,14 @@ int main(int argc, const char **argv)
ret = set_locale();
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("set_locale() failed (%d): %s\n", ret, strerror(ret)));
+ "set_locale() failed (%d): %s\n", ret, strerror(ret));
ret = EXIT_FAILURE;
goto fini;
}
mem_ctx = talloc_new(NULL);
if (!mem_ctx) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("Not enough memory\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, "Not enough memory\n");
ret = EXIT_FAILURE;
goto fini;
}
@@ -266,7 +266,7 @@ int main(int argc, const char **argv)
ret = getaddrinfo(pc_host, strport, &ai_hint, &ai);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE,
- ("getaddrinfo() failed (%d): %s\n", ret, gai_strerror(ret)));
+ "getaddrinfo() failed (%d): %s\n", ret, gai_strerror(ret));
} else {
host = ai[0].ai_canonname;
}
@@ -275,7 +275,7 @@ int main(int argc, const char **argv)
canonhost, NI_MAXHOST, NULL, 0, NI_NAMEREQD);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE,
- ("getnameinfo() failed (%d): %s\n", ret, gai_strerror(ret)));
+ "getnameinfo() failed (%d): %s\n", ret, gai_strerror(ret));
} else {
host = canonhost;
}
@@ -287,7 +287,7 @@ int main(int argc, const char **argv)
host, pc_domain, pc_host, &ent);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)));
+ "sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret));
}
}