summaryrefslogtreecommitdiffstats
path: root/src/providers/dp_auth_util.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/dp_auth_util.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/dp_auth_util.c')
-rw-r--r--src/providers/dp_auth_util.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/providers/dp_auth_util.c b/src/providers/dp_auth_util.c
index 0bf10a7d2..98b2f5d46 100644
--- a/src/providers/dp_auth_util.c
+++ b/src/providers/dp_auth_util.c
@@ -102,26 +102,26 @@ bool dp_unpack_pam_request(DBusMessage *msg, TALLOC_CTX *mem_ctx,
DBUS_TYPE_INVALID);
if (!db_ret) {
- DEBUG(1, ("dbus_message_get_args failed.\n"));
+ DEBUG(1, "dbus_message_get_args failed.\n");
return false;
}
ret = copy_pam_data(mem_ctx, &pd, new_pd);
if (ret != EOK) {
- DEBUG(1, ("copy_pam_data failed.\n"));
+ DEBUG(1, "copy_pam_data failed.\n");
return false;
}
ret = sss_authtok_set((*new_pd)->authtok, authtok_type,
authtok_data, authtok_length);
if (ret) {
- DEBUG(1, ("Failed to set auth token: %d [%s]\n", ret, strerror(ret)));
+ DEBUG(1, "Failed to set auth token: %d [%s]\n", ret, strerror(ret));
return false;
}
ret = sss_authtok_set((*new_pd)->newauthtok, new_authtok_type,
new_authtok_data, new_authtok_length);
if (ret) {
- DEBUG(1, ("Failed to set auth token: %d [%s]\n", ret, strerror(ret)));
+ DEBUG(1, "Failed to set auth token: %d [%s]\n", ret, strerror(ret));
return false;
}
@@ -216,30 +216,30 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db
const uint8_t *data;
if (!dbus_message_iter_init(msg, &iter)) {
- DEBUG(1, ("pam response has no arguments.\n"));
+ DEBUG(1, "pam response has no arguments.\n");
return false;
}
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
dbus_message_iter_get_basic(&iter, &(pd->pam_status));
if (!dbus_message_iter_next(&iter)) {
- DEBUG(1, ("pam response has too few arguments.\n"));
+ DEBUG(1, "pam response has too few arguments.\n");
return false;
}
/* After this point will be an array of pam data */
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) {
- DEBUG(1, ("pam response format error.\n"));
- DEBUG(1, ("Type was %c\n", (char)dbus_message_iter_get_arg_type(&iter)));
+ DEBUG(1, "pam response format error.\n");
+ DEBUG(1, "Type was %c\n", (char)dbus_message_iter_get_arg_type(&iter));
return false;
}
if (dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_STRUCT) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
@@ -247,7 +247,7 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db
while (dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID) {
/* Read in a pam data struct */
if (dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_STRUCT) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
@@ -257,20 +257,20 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db
/* Get the pam data type */
if (dbus_message_iter_get_arg_type(&struct_iter) != DBUS_TYPE_UINT32) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
dbus_message_iter_get_basic(&struct_iter, &type);
if (!dbus_message_iter_next(&struct_iter)) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
/* Get the byte array */
if (dbus_message_iter_get_arg_type(&struct_iter) != DBUS_TYPE_ARRAY ||
dbus_message_iter_get_element_type(&struct_iter) != DBUS_TYPE_BYTE) {
- DEBUG(1, ("pam response format error.\n"));
+ DEBUG(1, "pam response format error.\n");
return false;
}
@@ -278,7 +278,7 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db
dbus_message_iter_get_fixed_array(&sub_iter, &data, &len);
if (pam_add_response(pd, type, len, data) != EOK) {
- DEBUG(1, ("pam_add_response failed.\n"));
+ DEBUG(1, "pam_add_response failed.\n");
return false;
}
dbus_message_iter_next(&array_iter);
@@ -303,8 +303,8 @@ void dp_id_callback(DBusPendingCall *pending, void *ptr)
* until reply is valid or timeout has occurred. If reply is NULL
* here, something is seriously wrong and we should bail out.
*/
- DEBUG(0, ("Severe error. A reply callback was called but no"
- " reply was received and no timeout occurred\n"));
+ DEBUG(0, "Severe error. A reply callback was called but no"
+ " reply was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */
goto done;
@@ -317,19 +317,19 @@ void dp_id_callback(DBusPendingCall *pending, void *ptr)
DBUS_TYPE_UINT16, &dp_ver,
DBUS_TYPE_INVALID);
if (!ret) {
- DEBUG(1, ("Failed to parse message\n"));
+ DEBUG(1, "Failed to parse message\n");
if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
/* FIXME: Destroy this connection ? */
goto done;
}
- DEBUG(4, ("Got id ack and version (%d) from DP\n", dp_ver));
+ DEBUG(4, "Got id ack and version (%d) from DP\n", dp_ver);
break;
case DBUS_MESSAGE_TYPE_ERROR:
- DEBUG(0,("The Monitor returned an error [%s]\n",
- dbus_message_get_error_name(reply)));
+ DEBUG(0,"The Monitor returned an error [%s]\n",
+ dbus_message_get_error_name(reply));
/* Falling through to default intentionally*/
default:
/*
@@ -362,19 +362,19 @@ int dp_common_send_id(struct sbus_connection *conn, uint16_t version,
DP_INTERFACE,
DP_METHOD_REGISTER);
if (msg == NULL) {
- DEBUG(0, ("Out of memory?!\n"));
+ DEBUG(0, "Out of memory?!\n");
return ENOMEM;
}
- DEBUG(4, ("Sending ID to DP: (%d,%s)\n",
- version, name));
+ DEBUG(4, "Sending ID to DP: (%d,%s)\n",
+ version, name);
ret = dbus_message_append_args(msg,
DBUS_TYPE_UINT16, &version,
DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID);
if (!ret) {
- DEBUG(1, ("Failed to build message\n"));
+ DEBUG(1, "Failed to build message\n");
return EIO;
}