diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-02 10:58:19 +0200 |
commit | b0d759c9a604add0573c04b1a4e88e1605e1fdc0 (patch) | |
tree | 15c83ce34cd254a30cc42c212123b7f194c21677 /src/providers/proxy | |
parent | b9afd88065ecdb9c2cafb2ee767bd61585b31b8f (diff) | |
download | sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.gz sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.xz sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.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
(identical to commit a3c8390d19593b1e5277d95bfb4ab206d4785150):
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')
-rw-r--r-- | src/providers/proxy/proxy_auth.c | 134 | ||||
-rw-r--r-- | src/providers/proxy/proxy_child.c | 100 | ||||
-rw-r--r-- | src/providers/proxy/proxy_id.c | 236 | ||||
-rw-r--r-- | src/providers/proxy/proxy_init.c | 98 | ||||
-rw-r--r-- | src/providers/proxy/proxy_netgroup.c | 38 | ||||
-rw-r--r-- | src/providers/proxy/proxy_services.c | 32 |
6 files changed, 319 insertions, 319 deletions
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c index 61fec63aa..2e9d452bc 100644 --- a/src/providers/proxy/proxy_auth.c +++ b/src/providers/proxy/proxy_auth.c @@ -64,7 +64,7 @@ void proxy_pam_handler(struct be_req *req) be_req_terminate(req, DP_ERR_OK, EOK, NULL); return; default: - DEBUG(1, ("Unsupported PAM task.\n")); + DEBUG(1, "Unsupported PAM task.\n"); pd->pam_status = PAM_MODULE_UNKNOWN; be_req_terminate(req, DP_ERR_OK, EINVAL, "Unsupported PAM task"); return; @@ -102,13 +102,13 @@ static int proxy_child_destructor(TALLOC_CTX *ctx) hash_key_t key; int hret; - DEBUG(8, ("Removing proxy child id [%d]\n", child_ctx->id)); + DEBUG(8, "Removing proxy child id [%d]\n", child_ctx->id); key.type = HASH_KEY_ULONG; key.ul = child_ctx->id; hret = hash_delete(child_ctx->auth_ctx->request_table, &key); if (!(hret == HASH_SUCCESS || hret == HASH_ERROR_KEY_NOT_FOUND)) { - DEBUG(1, ("Hash error [%d][%s]\n", hret, hash_error_string(hret))); + DEBUG(1, "Hash error [%d][%s]\n", hret, hash_error_string(hret)); /* Nothing we can do about this, so just continue */ } return 0; @@ -132,7 +132,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct proxy_child_ctx); if (req == NULL) { - DEBUG(1, ("Could not send PAM request to child\n")); + DEBUG(1, "Could not send PAM request to child\n"); return NULL; } @@ -156,7 +156,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, if (auth_ctx->next_id == first) { /* We've looped through all possible integers! */ - DEBUG(0, ("Serious error: queue is too long!\n")); + DEBUG(0, "Serious error: queue is too long!\n"); talloc_zfree(req); return NULL; } @@ -167,11 +167,11 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, value.type = HASH_VALUE_PTR; value.ptr = req; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Queueing request [%lu]\n", key.ul)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Queueing request [%lu]\n", key.ul); hret = hash_enter(auth_ctx->request_table, &key, &value); if (hret != HASH_SUCCESS) { - DEBUG(1, ("Could not add request to the queue\n")); + DEBUG(1, "Could not add request to the queue\n"); talloc_zfree(req); return NULL; } @@ -187,7 +187,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, auth_ctx->running++; subreq = proxy_child_init_send(auth_ctx, state, auth_ctx); if (!subreq) { - DEBUG(1, ("Could not fork child process\n")); + DEBUG(1, "Could not fork child process\n"); auth_ctx->running--; talloc_zfree(req); return NULL; @@ -200,7 +200,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, /* If there was no available slot, it will be queued * until a slot is available */ - DEBUG(8, ("All available child slots are full, queuing request\n")); + DEBUG(8, "All available child slots are full, queuing request\n"); } return req; } @@ -234,7 +234,7 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct pc_init_ctx); if (req == NULL) { - DEBUG(1, ("Could not create tevent_req\n")); + DEBUG(1, "Could not create tevent_req\n"); return NULL; } @@ -248,16 +248,16 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, auth_ctx->be->domain->name, child_ctx->id); if (state->command == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return NULL; } - DEBUG(7, ("Starting proxy child with args [%s]\n", state->command)); + DEBUG(7, "Starting proxy child with args [%s]\n", state->command); pid = fork(); if (pid < 0) { ret = errno; - DEBUG(1, ("fork failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fork failed [%d][%s].\n", ret, strerror(ret)); talloc_zfree(req); return NULL; } @@ -267,8 +267,8 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, execvp(proxy_child_args[0], proxy_child_args); ret = errno; - DEBUG(0, ("Could not start proxy child [%s]: [%d][%s].\n", - state->command, ret, strerror(ret))); + DEBUG(0, "Could not start proxy child [%s]: [%d][%s].\n", + state->command, ret, strerror(ret)); _exit(1); } @@ -282,7 +282,7 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, SIGCHLD, SA_SIGINFO, pc_init_sig_handler, req); if (state->sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); talloc_zfree(req); return NULL; } @@ -322,42 +322,42 @@ static void pc_init_sig_handler(struct tevent_context *ev, struct pc_init_ctx *init_ctx; if (count <= 0) { - DEBUG(0, ("SIGCHLD handler called with invalid child count\n")); + DEBUG(0, "SIGCHLD handler called with invalid child count\n"); return; } req = talloc_get_type(pvt, struct tevent_req); init_ctx = tevent_req_data(req, struct pc_init_ctx); - DEBUG(7, ("Waiting for child [%d].\n", init_ctx->pid)); + DEBUG(7, "Waiting for child [%d].\n", init_ctx->pid); errno = 0; ret = waitpid(init_ctx->pid, &child_status, WNOHANG); if (ret == -1) { ret = errno; - DEBUG(1, ("waitpid failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "waitpid failed [%d][%s].\n", ret, strerror(ret)); } else if (ret == 0) { - DEBUG(1, ("waitpid did not find a child with changed status.\n")); + DEBUG(1, "waitpid did not find a child with changed status.\n"); } else { if (WIFEXITED(child_status)) { - DEBUG(4, ("child [%d] exited with status [%d].\n", ret, - WEXITSTATUS(child_status))); + DEBUG(4, "child [%d] exited with status [%d].\n", ret, + WEXITSTATUS(child_status)); tevent_req_error(req, EIO); } else if (WIFSIGNALED(child_status)) { - DEBUG(4, ("child [%d] was terminate by signal [%d].\n", ret, - WTERMSIG(child_status))); + DEBUG(4, "child [%d] was terminate by signal [%d].\n", ret, + WTERMSIG(child_status)); tevent_req_error(req, EIO); } else { if (WIFSTOPPED(child_status)) { - DEBUG(1, ("child [%d] was stopped by signal [%d].\n", ret, - WSTOPSIG(child_status))); + DEBUG(1, "child [%d] was stopped by signal [%d].\n", ret, + WSTOPSIG(child_status)); } if (WIFCONTINUED(child_status)) { - DEBUG(1, ("child [%d] was resumed by delivery of SIGCONT.\n", - ret)); + DEBUG(1, "child [%d] was resumed by delivery of SIGCONT.\n", + ret); } - DEBUG(1, ("Child is still running, no new child is started.\n")); + DEBUG(1, "Child is still running, no new child is started.\n"); return; } } @@ -369,7 +369,7 @@ static void pc_init_timeout(struct tevent_context *ev, { struct tevent_req *req; - DEBUG(2, ("Client timed out before Identification!\n")); + DEBUG(2, "Client timed out before Identification!\n"); req = talloc_get_type(ptr, struct tevent_req); tevent_req_error(req, ETIMEDOUT); } @@ -421,7 +421,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { ret = proxy_child_init_recv(subreq, &child_ctx->pid, &child_ctx->conn); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("Proxy child init failed [%d]\n", ret)); + DEBUG(6, "Proxy child init failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -431,7 +431,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { child_ctx->conn, child_ctx->pd, child_ctx->pid); if (!subreq) { - DEBUG(1,("Could not start PAM conversation\n")); + DEBUG(1,"Could not start PAM conversation\n"); tevent_req_error(req, EIO); return; } @@ -443,7 +443,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { */ sig_ctx = talloc_zero(child_ctx->auth_ctx, struct proxy_child_sig_ctx); if(sig_ctx == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -456,7 +456,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { proxy_child_sig_handler, sig_ctx); if (sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -485,44 +485,44 @@ static void proxy_child_sig_handler(struct tevent_context *ev, struct tevent_immediate *imm2; if (count <= 0) { - DEBUG(0, ("SIGCHLD handler called with invalid child count\n")); + DEBUG(0, "SIGCHLD handler called with invalid child count\n"); return; } sig_ctx = talloc_get_type(pvt, struct proxy_child_sig_ctx); - DEBUG(7, ("Waiting for child [%d].\n", sig_ctx->pid)); + DEBUG(7, "Waiting for child [%d].\n", sig_ctx->pid); errno = 0; ret = waitpid(sig_ctx->pid, &child_status, WNOHANG); if (ret == -1) { ret = errno; - DEBUG(1, ("waitpid failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "waitpid failed [%d][%s].\n", ret, strerror(ret)); } else if (ret == 0) { - DEBUG(1, ("waitpid did not found a child with changed status.\n")); + DEBUG(1, "waitpid did not found a child with changed status.\n"); } else { if (WIFEXITED(child_status)) { - DEBUG(4, ("child [%d] exited with status [%d].\n", ret, - WEXITSTATUS(child_status))); + DEBUG(4, "child [%d] exited with status [%d].\n", ret, + WEXITSTATUS(child_status)); } else if (WIFSIGNALED(child_status)) { - DEBUG(4, ("child [%d] was terminated by signal [%d].\n", ret, - WTERMSIG(child_status))); + DEBUG(4, "child [%d] was terminated by signal [%d].\n", ret, + WTERMSIG(child_status)); } else { if (WIFSTOPPED(child_status)) { - DEBUG(1, ("child [%d] was stopped by signal [%d].\n", ret, - WSTOPSIG(child_status))); + DEBUG(1, "child [%d] was stopped by signal [%d].\n", ret, + WSTOPSIG(child_status)); } if (WIFCONTINUED(child_status)) { - DEBUG(1, ("child [%d] was resumed by delivery of SIGCONT.\n", - ret)); + DEBUG(1, "child [%d] was resumed by delivery of SIGCONT.\n", + ret); } - DEBUG(1, ("Child is still running, no new child is started.\n")); + DEBUG(1, "Child is still running, no new child is started.\n"); return; } imm = tevent_create_immediate(ev); if (imm == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); return; } @@ -532,7 +532,7 @@ static void proxy_child_sig_handler(struct tevent_context *ev, /* schedule another immediate timer to delete the sigchld handler */ imm2 = tevent_create_immediate(ev); if (imm2 == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); return; } @@ -583,17 +583,17 @@ static struct tevent_req *proxy_pam_conv_send(TALLOC_CTX *mem_ctx, DP_INTERFACE, DP_METHOD_PAMHANDLER); if (msg == NULL) { - DEBUG(1, ("dbus_message_new_method_call failed.\n")); + DEBUG(1, "dbus_message_new_method_call failed.\n"); talloc_zfree(req); return NULL; } - DEBUG(4, ("Sending request with the following data:\n")); + DEBUG(4, "Sending request with the following data:\n"); DEBUG_PAM_DATA(4, pd); dp_ret = dp_pack_pam_request(msg, pd); if (!dp_ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); dbus_message_unref(msg); talloc_zfree(req); return NULL; @@ -620,7 +620,7 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) int type; int ret; - DEBUG(8, ("Handling pam conversation reply\n")); + DEBUG(8, "Handling pam conversation reply\n"); req = talloc_get_type(ptr, struct tevent_req); state = tevent_req_data(req, struct proxy_conv_ctx); @@ -630,8 +630,8 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) reply = dbus_pending_call_steal_reply(pending); dbus_pending_call_unref(pending); if (reply == NULL) { - 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"); state->pd->pam_status = PAM_SYSTEM_ERR; tevent_req_error(req, EIO); } @@ -641,23 +641,23 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) case DBUS_MESSAGE_TYPE_METHOD_RETURN: ret = dp_unpack_pam_response(reply, state->pd, &dbus_error); if (!ret) { - DEBUG(0, ("Failed to parse reply.\n")); + DEBUG(0, "Failed to parse reply.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dbus_message_unref(reply); tevent_req_error(req, EIO); return; } - DEBUG(4, ("received: [%d][%s]\n", + DEBUG(4, "received: [%d][%s]\n", state->pd->pam_status, - state->pd->domain)); + state->pd->domain); break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0, ("Reply error [%s].\n", - dbus_message_get_error_name(reply))); + DEBUG(0, "Reply error [%s].\n", + dbus_message_get_error_name(reply)); state->pd->pam_status = PAM_SYSTEM_ERR; break; default: - DEBUG(0, ("Default... what now?.\n")); + DEBUG(0, "Default... what now?.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; } dbus_message_unref(reply); @@ -686,7 +686,7 @@ static void proxy_pam_conv_done(struct tevent_req *subreq) ret = proxy_pam_conv_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("Proxy PAM conversation failed [%d]\n", ret)); + DEBUG(6, "Proxy PAM conversation failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -725,7 +725,7 @@ static void proxy_child_done(struct tevent_req *req) client_ctx->auth_ctx->running--; imm = tevent_create_immediate(be_ctx->ev); if (imm == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); /* We'll still finish the current request, but we're * likely to have problems if there are queued events * if we've gotten into this state. @@ -753,7 +753,7 @@ static void proxy_child_done(struct tevent_req *req) ret = sss_authtok_get_password(pd->authtok, &password, NULL); if (ret) { /* password caching failures are not fatal errors */ - DEBUG(2, ("Failed to cache password\n")); + DEBUG(2, "Failed to cache password\n"); goto done; } @@ -763,8 +763,8 @@ static void proxy_child_done(struct tevent_req *req) /* password caching failures are not fatal errors */ /* so we just log it any return */ if (ret != EOK) { - DEBUG(2, ("Failed to cache password (%d)[%s]!?\n", - ret, strerror(ret))); + DEBUG(2, "Failed to cache password (%d)[%s]!?\n", + ret, strerror(ret)); } } @@ -808,7 +808,7 @@ static void run_proxy_child_queue(struct tevent_context *ev, auth_ctx->running++; subreq = proxy_child_init_send(auth_ctx, state, auth_ctx); if (!subreq) { - DEBUG(1, ("Could not fork child process\n")); + DEBUG(1, "Could not fork child process\n"); auth_ctx->running--; talloc_zfree(req); return; diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c index 66afcfb64..09a3b4b3b 100644 --- a/src/providers/proxy/proxy_child.c +++ b/src/providers/proxy/proxy_child.c @@ -95,7 +95,7 @@ static int proxy_internal_conv(int num_msg, const struct pam_message **msgm, for (i=0; i < num_msg; i++) { switch( msgm[i]->msg_style ) { case PAM_PROMPT_ECHO_OFF: - DEBUG(4, ("Conversation message: [%s]\n", msgm[i]->msg)); + DEBUG(4, "Conversation message: [%s]\n", msgm[i]->msg); reply[i].resp_retcode = 0; ret = sss_authtok_get_password(auth_data->authtok, @@ -107,8 +107,8 @@ static int proxy_internal_conv(int num_msg, const struct pam_message **msgm, break; default: - DEBUG(1, ("Conversation style %d not supported.\n", - msgm[i]->msg_style)); + DEBUG(1, "Conversation style %d not supported.\n", + msgm[i]->msg_style); goto failed; } } @@ -144,7 +144,7 @@ static int proxy_chauthtok_conv(int num_msg, const struct pam_message **msgm, for (i=0; i < num_msg; i++) { switch( msgm[i]->msg_style ) { case PAM_PROMPT_ECHO_OFF: - DEBUG(4, ("Conversation message: [%s]\n", msgm[i]->msg)); + DEBUG(4, "Conversation message: [%s]\n", msgm[i]->msg); reply[i].resp_retcode = 0; if (!auth_data->sent_old) { @@ -170,8 +170,8 @@ static int proxy_chauthtok_conv(int num_msg, const struct pam_message **msgm, break; default: - DEBUG(1, ("Conversation style %d not supported.\n", - msgm[i]->msg_style)); + DEBUG(1, "Conversation style %d not supported.\n", + msgm[i]->msg_style); goto failed; } } @@ -202,18 +202,18 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) } auth_data = talloc_zero(pd, struct authtok_conv); if (auth_data == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; } auth_data->authtok = sss_authtok_new(auth_data); if (auth_data->authtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_authtok_new failed.\n"); ret = ENOMEM; goto fail; } auth_data->newauthtok = sss_authtok_new(auth_data); if (auth_data->newauthtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_authtok_new failed.\n"); ret = ENOMEM; goto fail; } @@ -222,22 +222,22 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) ret = pam_start(pam_target, pd->user, &conv, &pamh); if (ret == PAM_SUCCESS) { - DEBUG(7, ("Pam transaction started with service name [%s].\n", - pam_target)); + DEBUG(7, "Pam transaction started with service name [%s].\n", + pam_target); ret = pam_set_item(pamh, PAM_TTY, pd->tty); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_TTY failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_TTY failed: %s.\n", + pam_strerror(pamh, ret)); } ret = pam_set_item(pamh, PAM_RUSER, pd->ruser); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_RUSER failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_RUSER failed: %s.\n", + pam_strerror(pamh, ret)); } ret = pam_set_item(pamh, PAM_RHOST, pd->rhost); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_RHOST failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_RHOST failed: %s.\n", + pam_strerror(pamh, ret)); } switch (pd->cmd) { case SSS_PAM_AUTHENTICATE: @@ -275,21 +275,21 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) } break; default: - DEBUG(1, ("unknown PAM call\n")); + DEBUG(1, "unknown PAM call\n"); pam_status=PAM_ABORT; } - DEBUG(4, ("Pam result: [%d][%s]\n", pam_status, - pam_strerror(pamh, pam_status))); + DEBUG(4, "Pam result: [%d][%s]\n", pam_status, + pam_strerror(pamh, pam_status)); ret = pam_end(pamh, pam_status); if (ret != PAM_SUCCESS) { pamh=NULL; - DEBUG(1, ("Cannot terminate pam transaction.\n")); + DEBUG(1, "Cannot terminate pam transaction.\n"); } } else { - DEBUG(1, ("Failed to initialize pam transaction.\n")); + DEBUG(1, "Failed to initialize pam transaction.\n"); pam_status = PAM_SYSTEM_ERR; } @@ -323,8 +323,8 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn) reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(1, ("dbus_message_new_method_return failed, " - "cannot send reply.\n")); + DEBUG(1, "dbus_message_new_method_return failed, " + "cannot send reply.\n"); ret = ENOMEM; goto done; } @@ -333,7 +333,7 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn) ret = dp_unpack_pam_request(message, pc_ctx, &pd, &dbus_error); if (!ret) { - DEBUG(1,("Failed, to parse message!\n")); + DEBUG(1,"Failed, to parse message!\n"); ret = EIO; goto done; } @@ -346,20 +346,20 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn) goto done; } - DEBUG(4, ("Got request with the following data\n")); + DEBUG(4, "Got request with the following data\n"); DEBUG_PAM_DATA(4, pd); ret = call_pam_stack(pc_ctx->pam_target, pd); if (ret != EOK) { - DEBUG(1, ("call_pam_stack failed.\n")); + DEBUG(1, "call_pam_stack failed.\n"); } - DEBUG(4, ("Sending result [%d][%s]\n", - pd->pam_status, pd->domain)); + DEBUG(4, "Sending result [%d][%s]\n", + pd->pam_status, pd->domain); ret = dp_pack_pam_response(reply, pd); if (!ret) { - DEBUG(1, ("Failed to generate dbus reply\n")); + DEBUG(1, "Failed to generate dbus reply\n"); talloc_free(pd); dbus_message_unref(reply); ret = EIO; @@ -391,7 +391,7 @@ static int proxy_cli_init(struct pc_ctx *ctx) PIPE_PATH, PROXY_CHILD_PIPE, ctx->domain->name); if (sbus_address == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; } @@ -399,13 +399,13 @@ static int proxy_cli_init(struct pc_ctx *ctx) &pc_interface, &ctx->conn, NULL, ctx); if (ret != EOK) { - DEBUG(1, ("sbus_client_init failed.\n")); + DEBUG(1, "sbus_client_init failed.\n"); return ret; } ret = proxy_child_send_id(ctx->conn, DATA_PROVIDER_VERSION, ctx->id); if (ret != EOK) { - DEBUG(0, ("dp_common_send_id failed.\n")); + DEBUG(0, "dp_common_send_id failed.\n"); return ret; } @@ -426,19 +426,19 @@ int proxy_child_send_id(struct sbus_connection *conn, DP_INTERFACE, DP_METHOD_REGISTER); if (msg == NULL) { - DEBUG(0, ("Out of memory?!\n")); + DEBUG(0, "Out of memory?!\n"); return ENOMEM; } - DEBUG(SSSDBG_FUNC_DATA, ("Sending ID to Proxy Backend: (%d,%"PRIu32")\n", - version, id)); + DEBUG(SSSDBG_FUNC_DATA, "Sending ID to Proxy Backend: (%d,%"PRIu32")\n", + version, id); ret = dbus_message_append_args(msg, DBUS_TYPE_UINT16, &version, DBUS_TYPE_UINT32, &id, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); return EIO; } @@ -457,7 +457,7 @@ int proxy_child_process_init(TALLOC_CTX *mem_ctx, const char *domain, ctx = talloc_zero(mem_ctx, struct pc_ctx); if (!ctx) { - DEBUG(0, ("fatal error initializing pc_ctx\n")); + DEBUG(0, "fatal error initializing pc_ctx\n"); return ENOMEM; } ctx->ev = ev; @@ -466,19 +466,19 @@ int proxy_child_process_init(TALLOC_CTX *mem_ctx, const char *domain, ctx->id = id; ctx->conf_path = talloc_asprintf(ctx, CONFDB_DOMAIN_PATH_TMPL, domain); if (!ctx->conf_path) { - DEBUG(0, ("Out of memory!?\n")); + DEBUG(0, "Out of memory!?\n"); return ENOMEM; } ret = confdb_get_domain(cdb, domain, &ctx->domain); if (ret != EOK) { - DEBUG(0, ("fatal error retrieving domain configuration\n")); + DEBUG(0, "fatal error retrieving domain configuration\n"); return ret; } ret = proxy_cli_init(ctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up server bus\n")); + DEBUG(0, "fatal error setting up server bus\n"); return ret; } @@ -551,43 +551,43 @@ int main(int argc, const char *argv[]) ret = server_setup(srv_name, 0, conf_entry, &main_ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up mainloop [%d]\n", ret)); + DEBUG(0, "Could not set up mainloop [%d]\n", ret); return 2; } ret = unsetenv("_SSS_LOOPS"); if (ret != EOK) { - DEBUG(1, ("Failed to unset _SSS_LOOPS, " - "pam modules might not work as expected.\n")); + DEBUG(1, "Failed to unset _SSS_LOOPS, " + "pam modules might not work as expected.\n"); } ret = confdb_get_string(main_ctx->confdb_ctx, main_ctx, conf_entry, CONFDB_PROXY_PAM_TARGET, NULL, &pam_target); if (ret != EOK) { - DEBUG(0, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); return 4; } if (pam_target == NULL) { - DEBUG(1, ("Missing option proxy_pam_target.\n")); + DEBUG(1, "Missing option proxy_pam_target.\n"); return 4; } ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); } ret = proxy_child_process_init(main_ctx, domain, main_ctx->event_ctx, main_ctx->confdb_ctx, pam_target, (uint32_t)id); if (ret != EOK) { - DEBUG(0, ("Could not initialize proxy child [%d].\n", ret)); + DEBUG(0, "Could not initialize proxy child [%d].\n", ret); return 3; } - DEBUG(1, ("Proxy child for domain [%s] started!\n", domain)); + DEBUG(1, "Proxy child for domain [%s] started!\n", domain); /* loop on main */ server_loop(main_ctx); diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c index 2c01aad5a..26777fae8 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -60,7 +60,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, struct ldb_result *cached_pwd = NULL; const char *real_name = NULL; - DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by name (%s)\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching user by name (%s)\n", name); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -86,7 +86,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwnam failed [%d]: %s\n", ret, strerror(ret))); + "getpwnam failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -103,15 +103,15 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); } if (ret == EOK && cached_pwd->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_pwd->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached user has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached user has no name?\n"); } } } @@ -123,7 +123,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -143,8 +143,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getpwnam_r failed for '%s' <%d>: %s\n", - name, ret, strerror(ret))); + "proxy -> getpwnam_r failed for '%s' <%d>: %s\n", + name, ret, strerror(ret)); } return ret; } @@ -163,14 +163,14 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, switch (status) { case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_MINOR_FAILURE, ("User not found.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "User not found.\n"); *del_user = true; break; case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %"SPRIuid", %"SPRIgid")\n", - pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); + DEBUG(SSSDBG_TRACE_FUNC, "User found: (%s, %"SPRIuid", %"SPRIgid")\n", + pwd->pw_name, pwd->pw_uid, pwd->pw_gid); /* uid=0 or gid=0 are invalid values */ /* also check that the id is in the valid range for this domain */ @@ -178,7 +178,7 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_MINOR_FAILURE, - ("User filtered out! (id out of range)\n")); + "User filtered out! (id out of range)\n"); *del_user = true; break; } @@ -186,12 +186,12 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, case NSS_STATUS_UNAVAIL: DEBUG(SSSDBG_MINOR_FAILURE, - ("Remote back end is not available. Entering offline mode\n")); + "Remote back end is not available. Entering offline mode\n"); ret = ENXIO; break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Unknown return code %d\n", status)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown return code %d\n", status); ret = EIO; break; } @@ -207,8 +207,8 @@ delete_user(struct sysdb_ctx *sysdb, int ret = EOK; DEBUG(SSSDBG_TRACE_FUNC, - ("User %s does not exist (or is invalid) on remote server," - " deleting!\n", name)); + "User %s does not exist (or is invalid) on remote server," + " deleting!\n", name); ret = sysdb_delete_user(sysdb, domain, name, uid); if (ret == ENOENT) { ret = EOK; @@ -242,7 +242,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, if (lowercase || alias) { attrs = sysdb_new_attrs(NULL); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); return ENOMEM; } } @@ -250,7 +250,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, if (lowercase) { ret = sysdb_attrs_add_lc_name_alias(attrs, pwd->pw_name); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); talloc_zfree(attrs); return ret; } @@ -265,7 +265,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, cased_alias); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); talloc_zfree(attrs); return ret; } @@ -286,7 +286,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, 0); talloc_zfree(attrs); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add user to cache\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add user to cache\n"); return ret; } @@ -309,7 +309,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx, bool del_user = false; int ret; - DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by uid (%"SPRIuid")\n", uid)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching user by uid (%"SPRIuid")\n", uid); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -333,7 +333,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -349,8 +349,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n", - uid, ret, strerror(ret))); + "proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n", + uid, ret, strerror(ret)); } return ret; } @@ -373,7 +373,7 @@ static int enum_users(TALLOC_CTX *mem_ctx, errno_t sret; bool again; - DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating users\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumerating users\n"); tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -395,7 +395,7 @@ static int enum_users(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -436,11 +436,11 @@ static int enum_users(TALLOC_CTX *mem_ctx, case NSS_STATUS_NOTFOUND: /* we are done here */ - DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumeration completed.\n"); ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -449,8 +449,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, case NSS_STATUS_SUCCESS: DEBUG(SSSDBG_TRACE_LIBS, - ("User found (%s, %"SPRIuid", %"SPRIgid")\n", - pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); + "User found (%s, %"SPRIuid", %"SPRIgid")\n", + pwd->pw_name, pwd->pw_uid, pwd->pw_gid); /* uid=0 or gid=0 are invalid values */ /* also check that the id is in the valid range for this domain @@ -458,8 +458,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, if (OUT_OF_ID_RANGE(pwd->pw_uid, dom->id_min, dom->id_max) || OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) { - DEBUG(SSSDBG_OP_FAILURE, ("User [%s] filtered out! (id out" - " of range)\n", pwd->pw_name)); + DEBUG(SSSDBG_OP_FAILURE, "User [%s] filtered out! (id out" + " of range)\n", pwd->pw_name); again = true; break; @@ -470,8 +470,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, if (ret) { /* Do not fail completely on errors. * Just report the failure to save and go on */ - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store user %s." - " Ignoring.\n", pwd->pw_name)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store user %s." + " Ignoring.\n", pwd->pw_name); } again = true; break; @@ -483,8 +483,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, default: ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("proxy -> getpwent_r failed (%d)[%s]" - "\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "proxy -> getpwent_r failed (%d)[%s]" + "\n", ret, strerror(ret)); break; } } while (again); @@ -494,7 +494,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } ctx->ops.endpwent(); @@ -506,16 +506,16 @@ done: do { \ if (DEBUG_IS_SET(debug_get_level(level))) { \ if (!grp->gr_mem || !grp->gr_mem[0]) { \ - DEBUG(level, ("Group %s has no members!\n", \ - grp->gr_name)); \ + DEBUG(level, "Group %s has no members!\n", \ + grp->gr_name); \ } else { \ int i = 0; \ while (grp->gr_mem[i]) { \ /* count */ \ i++; \ } \ - DEBUG(level, ("Group %s has %d members!\n", \ - grp->gr_name, i)); \ + DEBUG(level, "Group %s has %d members!\n", \ + grp->gr_name, i); \ } \ } \ } while(0) @@ -546,7 +546,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -554,7 +554,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (grp->gr_mem && grp->gr_mem[0]) { attrs = sysdb_new_attrs(tmp_ctx); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); ret = ENOMEM; goto done; } @@ -563,14 +563,14 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, attrs, SYSDB_MEMBER, dom->name, (const char *const *)grp->gr_mem); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group members\n"); goto done; } /* Create ghost users */ ret = proxy_process_missing_users(sysdb, dom, attrs, grp, now); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add missing members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add missing members\n"); goto done; } } @@ -579,7 +579,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (!attrs) { attrs = sysdb_new_attrs(tmp_ctx); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); ret = ENOMEM; goto done; } @@ -588,7 +588,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (dom->case_sensitive == false) { ret = sysdb_attrs_add_lc_name_alias(attrs, grp->gr_name); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); ret = ENOMEM; goto done; } @@ -603,7 +603,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, cased_alias); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); ret = ENOMEM; goto done; } @@ -617,15 +617,15 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, cache_timeout, now); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group to cache\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group to cache\n"); goto done; } ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit transaction: [%s]\n", - strerror(ret))); + "Could not commit transaction: [%s]\n", + strerror(ret)); goto done; } in_transaction = false; @@ -634,7 +634,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -663,28 +663,28 @@ static errno_t proxy_process_missing_users(struct sysdb_ctx *sysdb, if (ret == EOK) { /* Member already exists in the cache */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Member [%s] already cached\n", grp->gr_mem[i])); + "Member [%s] already cached\n", grp->gr_mem[i]); /* clean up */ talloc_zfree(msg); continue; } else if (ret == ENOENT) { /* No entry for this user. Create a ghost user */ DEBUG(SSSDBG_TRACE_LIBS, - ("Member [%s] not cached, creating ghost user entry\n", - grp->gr_mem[i])); + "Member [%s] not cached, creating ghost user entry\n", + grp->gr_mem[i]); ret = sysdb_attrs_add_string(group_attrs, SYSDB_GHOST, grp->gr_mem[i]); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot store ghost user entry: [%d]: %s\n", - ret, strerror(ret))); + "Cannot store ghost user entry: [%d]: %s\n", + ret, strerror(ret)); goto done; } } else { /* Unexpected error */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Error searching cache for user [%s]: [%s]\n", - grp->gr_mem[i], strerror(ret))); + "Error searching cache for user [%s]: [%s]\n", + grp->gr_mem[i], strerror(ret)); goto done; } } @@ -728,23 +728,23 @@ handle_getgr_result(enum nss_status status, struct group *grp, { switch (status) { case NSS_STATUS_TRYAGAIN: - DEBUG(SSSDBG_MINOR_FAILURE, ("Buffer too small\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Buffer too small\n"); return EAGAIN; case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_MINOR_FAILURE, ("Group not found.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Group not found.\n"); *delete_group = true; break; case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_FUNC_DATA, ("Group found: (%s, %"SPRIgid")\n", - grp->gr_name, grp->gr_gid)); + DEBUG(SSSDBG_FUNC_DATA, "Group found: (%s, %"SPRIgid")\n", + grp->gr_name, grp->gr_gid); /* gid=0 is an invalid value */ /* also check that the id is in the valid range for this domain */ if (OUT_OF_ID_RANGE(grp->gr_gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Group filtered out! (id out of range)\n")); + "Group filtered out! (id out of range)\n"); *delete_group = true; break; } @@ -752,11 +752,11 @@ handle_getgr_result(enum nss_status status, struct group *grp, case NSS_STATUS_UNAVAIL: DEBUG(SSSDBG_MINOR_FAILURE, - ("Remote back end is not available. Entering offline mode\n")); + "Remote back end is not available. Entering offline mode\n"); return ENXIO; default: - DEBUG(SSSDBG_OP_FAILURE, ("Unknown return code %d\n", status)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown return code %d\n", status); return EIO; } @@ -780,7 +780,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, struct ldb_result *cached_grp = NULL; const char *real_name = NULL; - DEBUG(SSSDBG_FUNC_DATA, ("Searching group by name (%s)\n", name)); + DEBUG(SSSDBG_FUNC_DATA, "Searching group by name (%s)\n", name); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -791,8 +791,8 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, if (!grp) { ret = ENOMEM; DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getgrnam_r failed for '%s': [%d] %s\n", - name, ret, strerror(ret))); + "proxy -> getgrnam_r failed for '%s': [%d] %s\n", + name, ret, strerror(ret)); goto done; } @@ -812,7 +812,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrnam failed [%d]: %s\n", ret, strerror(ret))); + "getgrnam failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -823,15 +823,15 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, ret = sysdb_getgrgid(tmpctx, sysdb, dom, gid, &cached_grp); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); } if (ret == EOK && cached_grp->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_grp->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached group has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached group has no name?\n"); } } } @@ -855,7 +855,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrgid failed [%d]: %s\n", ret, strerror(ret))); + "getgrgid failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -864,8 +864,8 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, if (delete_group) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group %s does not exist (or is invalid) on remote server," - " deleting!\n", name)); + "Group %s does not exist (or is invalid) on remote server," + " deleting!\n", name); ret = sysdb_delete_group(sysdb, dom, NULL, gid); if (ret == ENOENT) { @@ -877,7 +877,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, ret = save_group(sysdb, dom, grp, real_name, name, dom->group_timeout); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save group [%d]: %s\n", ret, strerror(ret))); + "Cannot save group [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -885,8 +885,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getgrnam_r failed for '%s' <%d>: %s\n", - name, ret, strerror(ret))); + "proxy -> getgrnam_r failed for '%s' <%d>: %s\n", + name, ret, strerror(ret)); } return ret; } @@ -907,7 +907,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx, bool delete_group = false; int ret; - DEBUG(SSSDBG_TRACE_FUNC, ("Searching group by gid (%"SPRIgid")\n", gid)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching group by gid (%"SPRIgid")\n", gid); tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -936,14 +936,14 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx, if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrgid failed [%d]: %s\n", ret, strerror(ret))); + "getgrgid failed [%d]: %s\n", ret, strerror(ret)); goto done; } if (delete_group) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group %"SPRIgid" does not exist (or is invalid) on remote " - "server, deleting!\n", gid)); + "Group %"SPRIgid" does not exist (or is invalid) on remote " + "server, deleting!\n", gid); ret = sysdb_delete_group(sysdb, dom, NULL, gid); if (ret == ENOENT) { @@ -955,7 +955,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx, ret = save_group(sysdb, dom, grp, grp->gr_name, NULL, dom->group_timeout); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save user [%d]: %s\n", ret, strerror(ret))); + "Cannot save user [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -963,8 +963,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n", - gid, ret, strerror(ret))); + "proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n", + gid, ret, strerror(ret)); } return ret; } @@ -987,7 +987,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx, errno_t sret; bool again; - DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating groups\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumerating groups\n"); tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -1009,7 +1009,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1050,11 +1050,11 @@ static int enum_groups(TALLOC_CTX *mem_ctx, case NSS_STATUS_NOTFOUND: /* we are done here */ - DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumeration completed.\n"); ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1062,16 +1062,16 @@ static int enum_groups(TALLOC_CTX *mem_ctx, case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_OP_FAILURE, ("Group found (%s, %"SPRIgid")\n", - grp->gr_name, grp->gr_gid)); + DEBUG(SSSDBG_OP_FAILURE, "Group found (%s, %"SPRIgid")\n", + grp->gr_name, grp->gr_gid); /* gid=0 is an invalid value */ /* also check that the id is in the valid range for this domain */ if (OUT_OF_ID_RANGE(grp->gr_gid, dom->id_min, dom->id_max)) { - DEBUG(SSSDBG_OP_FAILURE, ("Group [%s] filtered out! (id" - "out of range)\n", grp->gr_name)); + DEBUG(SSSDBG_OP_FAILURE, "Group [%s] filtered out! (id" + "out of range)\n", grp->gr_name); again = true; break; @@ -1082,8 +1082,8 @@ static int enum_groups(TALLOC_CTX *mem_ctx, if (ret) { /* Do not fail completely on errors. * Just report the failure to save and go on */ - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store group." - "Ignoring\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store group." + "Ignoring\n"); } again = true; break; @@ -1095,8 +1095,8 @@ static int enum_groups(TALLOC_CTX *mem_ctx, default: ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("proxy -> getgrent_r failed (%d)[%s]" - "\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "proxy -> getgrent_r failed (%d)[%s]" + "\n", ret, strerror(ret)); break; } } while (again); @@ -1106,7 +1106,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } ctx->ops.endgrent(); @@ -1161,7 +1161,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1172,14 +1172,14 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwnam failed [%d]: %s\n", ret, strerror(ret))); + "getpwnam failed [%d]: %s\n", ret, strerror(ret)); goto fail; } if (del_user) { ret = delete_user(sysdb, dom, name, 0); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete user\n"); goto fail; } goto done; @@ -1193,15 +1193,15 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); } if (ret == EOK && cached_pwd->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_pwd->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached user has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached user has no name?\n"); } } } @@ -1213,7 +1213,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -1223,7 +1223,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx, if (del_user) { ret = delete_user(sysdb, dom, name, uid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete user\n"); goto fail; } goto done; @@ -1232,20 +1232,20 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = save_user(sysdb, dom, !dom->case_sensitive, pwd, real_name, name, dom->user_timeout); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not save user\n"); goto fail; } ret = get_initgr_groups_process(tmpctx, ctx, sysdb, dom, pwd); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not process initgroups\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not process initgroups\n"); goto fail; } done: ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1255,7 +1255,7 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } return ret; @@ -1317,13 +1317,13 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx, switch (status) { case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_FUNC_DATA, ("The initgroups call returned 'NOTFOUND'. " + DEBUG(SSSDBG_FUNC_DATA, "The initgroups call returned 'NOTFOUND'. " "Assume the user is only member of its " - "primary group (%"SPRIgid")\n", pwd->pw_gid)); + "primary group (%"SPRIgid")\n", pwd->pw_gid); /* fall through */ case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_CONF_SETTINGS, ("User [%s] appears to be member of %lu" - "groups\n", pwd->pw_name, num_gids)); + DEBUG(SSSDBG_CONF_SETTINGS, "User [%s] appears to be member of %lu" + "groups\n", pwd->pw_name, num_gids); now = time(NULL); for (i = 0; i < num_gids; i++) { @@ -1337,8 +1337,8 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx, break; default: - DEBUG(2, ("proxy -> initgroups_dyn failed (%d)[%s]\n", - ret, strerror(ret))); + DEBUG(2, "proxy -> initgroups_dyn failed (%d)[%s]\n", + ret, strerror(ret)); ret = EIO; break; } @@ -1496,7 +1496,7 @@ void proxy_get_account_info(struct be_req *breq) if (ret) { if (ret == ENXIO) { - DEBUG(2, ("proxy returned UNAVAIL error, going offline!\n")); + DEBUG(2, "proxy returned UNAVAIL error, going offline!\n"); be_mark_offline(be_ctx); } be_req_terminate(breq, DP_ERR_FATAL, ret, NULL); diff --git a/src/providers/proxy/proxy_init.c b/src/providers/proxy/proxy_init.c index 491482d8c..f2ad14475 100644 --- a/src/providers/proxy/proxy_init.c +++ b/src/providers/proxy/proxy_init.c @@ -125,8 +125,8 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->handle = dlopen(libpath, RTLD_NOW); if (!ctx->handle) { - DEBUG(0, ("Unable to load %s module with path, error: %s\n", - libpath, dlerror())); + DEBUG(0, "Unable to load %s module with path, error: %s\n", + libpath, dlerror()); ret = ELIBACC; goto done; } @@ -134,7 +134,7 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwnam_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwnam_r", libname); if (!ctx->ops.getpwnam_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -142,14 +142,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwuid_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwuid_r", libname); if (!ctx->ops.getpwuid_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } ctx->ops.setpwent = proxy_dlsym(ctx->handle, "_nss_%s_setpwent", libname); if (!ctx->ops.setpwent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -157,14 +157,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwent_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwent_r", libname); if (!ctx->ops.getpwent_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } ctx->ops.endpwent = proxy_dlsym(ctx->handle, "_nss_%s_endpwent", libname); if (!ctx->ops.endpwent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -172,7 +172,7 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrnam_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrnam_r", libname); if (!ctx->ops.getgrnam_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -180,14 +180,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrgid_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrgid_r", libname); if (!ctx->ops.getgrgid_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } ctx->ops.setgrent = proxy_dlsym(ctx->handle, "_nss_%s_setgrent", libname); if (!ctx->ops.setgrent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -195,14 +195,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrent_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrent_r", libname); if (!ctx->ops.getgrent_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } ctx->ops.endgrent = proxy_dlsym(ctx->handle, "_nss_%s_endgrent", libname); if (!ctx->ops.endgrent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -210,34 +210,34 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.initgroups_dyn = proxy_dlsym(ctx->handle, "_nss_%s_initgroups_dyn", libname); if (!ctx->ops.initgroups_dyn) { - DEBUG(1, ("The '%s' library does not provides the " + DEBUG(1, "The '%s' library does not provides the " "_nss_XXX_initgroups_dyn function!\n" "initgroups will be slow as it will require " - "full groups enumeration!\n", libname)); + "full groups enumeration!\n", libname); } ctx->ops.setnetgrent = proxy_dlsym(ctx->handle, "_nss_%s_setnetgrent", libname); if (!ctx->ops.setnetgrent) { - DEBUG(0, ("Failed to load _nss_%s_setnetgrent, error: %s. " + DEBUG(0, "Failed to load _nss_%s_setnetgrent, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); } ctx->ops.getnetgrent_r = proxy_dlsym(ctx->handle, "_nss_%s_getnetgrent_r", libname); if (!ctx->ops.getgrent_r) { - DEBUG(0, ("Failed to load _nss_%s_getnetgrent_r, error: %s. " + DEBUG(0, "Failed to load _nss_%s_getnetgrent_r, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); } ctx->ops.endnetgrent = proxy_dlsym(ctx->handle, "_nss_%s_endnetgrent", libname); if (!ctx->ops.endnetgrent) { - DEBUG(0, ("Failed to load _nss_%s_endnetgrent, error: %s. " + DEBUG(0, "Failed to load _nss_%s_endnetgrent, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); } ctx->ops.getservbyname_r = proxy_dlsym(ctx->handle, @@ -245,10 +245,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservbyname_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservbyname_r, error: %s. " + "Failed to load _nss_%s_getservbyname_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); } ctx->ops.getservbyport_r = proxy_dlsym(ctx->handle, @@ -256,10 +256,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservbyport_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservbyport_r, error: %s. " + "Failed to load _nss_%s_getservbyport_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); } ctx->ops.setservent = proxy_dlsym(ctx->handle, @@ -267,10 +267,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.setservent) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_setservent, error: %s. " + "Failed to load _nss_%s_setservent, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); } ctx->ops.getservent_r = proxy_dlsym(ctx->handle, @@ -278,10 +278,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservent_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservent_r, error: %s. " + "Failed to load _nss_%s_getservent_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); } ctx->ops.endservent = proxy_dlsym(ctx->handle, @@ -289,10 +289,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.endservent) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_endservent, error: %s. " + "Failed to load _nss_%s_endservent, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); } *ops = &proxy_id_ops; @@ -329,7 +329,7 @@ static int proxy_client_init(struct sbus_connection *conn, void *data) proxy_cli = talloc_zero(conn, struct proxy_client); if (!proxy_cli) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -343,11 +343,11 @@ static int proxy_client_init(struct sbus_connection *conn, void *data) proxy_cli->timeout = tevent_add_timer(proxy_auth_ctx->be->ev, proxy_cli, tv, init_timeout, proxy_cli); if (!proxy_cli->timeout) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } - DEBUG(4, ("Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout)); + DEBUG(4, "Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout); /* Attach the client context to the connection context, so that it is * always available when we need to manage the connection. */ @@ -362,7 +362,7 @@ static void init_timeout(struct tevent_context *ev, { struct proxy_client *proxy_cli; - DEBUG(2, ("Client timed out before Identification [%p]!\n", te)); + DEBUG(2, "Client timed out before Identification [%p]!\n", te); proxy_cli = talloc_get_type(ptr, struct proxy_client); @@ -396,12 +396,12 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); proxy_cli = talloc_get_type(data, struct proxy_client); if (!proxy_cli) { - DEBUG(0, ("Connection holds no valid init data\n")); + DEBUG(0, "Connection holds no valid init data\n"); return EINVAL; } /* First thing, cancel the timeout */ - DEBUG(4, ("Cancel proxy client ID timeout [%p]\n", proxy_cli->timeout)); + DEBUG(4, "Cancel proxy client ID timeout [%p]\n", proxy_cli->timeout); talloc_zfree(proxy_cli->timeout); dbus_error_init(&dbus_error); @@ -411,20 +411,20 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT32, &cli_id, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(1, ("Failed to parse message, killing connection\n")); + DEBUG(1, "Failed to parse message, killing connection\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); sbus_disconnect(conn); /* FIXME: should we just talloc_zfree(conn) ? */ return EIO; } - DEBUG(SSSDBG_FUNC_DATA, ("Proxy client [%"PRIu32"] connected\n", cli_id)); + DEBUG(SSSDBG_FUNC_DATA, "Proxy client [%"PRIu32"] connected\n", cli_id); /* Check the hash table */ key.type = HASH_KEY_ULONG; key.ul = cli_id; if (!hash_has_key(proxy_cli->proxy_auth_ctx->request_table, &key)) { - DEBUG(1, ("Unknown child ID. Killing the connection\n")); + DEBUG(1, "Unknown child ID. Killing the connection\n"); sbus_disconnect(proxy_cli->conn); return EIO; } @@ -432,7 +432,7 @@ static int client_registration(DBusMessage *message, /* reply that all is ok */ reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(0, ("Dbus Out of memory!\n")); + DEBUG(0, "Dbus Out of memory!\n"); return ENOMEM; } @@ -440,7 +440,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(0, ("Failed to build dbus reply\n")); + DEBUG(0, "Failed to build dbus reply\n"); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -452,7 +452,7 @@ static int client_registration(DBusMessage *message, hret = hash_lookup(proxy_cli->proxy_auth_ctx->request_table, &key, &value); if (hret != HASH_SUCCESS) { - DEBUG(1, ("Hash error [%d][%s]\n", hret, hash_error_string(hret))); + DEBUG(1, "Hash error [%d][%s]\n", hret, hash_error_string(hret)); sbus_disconnect(conn); } @@ -466,8 +466,8 @@ static int client_registration(DBusMessage *message, * the init_req will be NULL below and things will * break. */ - DEBUG(1, ("Client connection from a request " - "that's not marked as running\n")); + DEBUG(1, "Client connection from a request " + "that's not marked as running\n"); return EIO; } @@ -490,7 +490,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, /* If we're already set up, just return that */ if(bectx->bet_info[BET_AUTH].mod_name && strcmp("proxy", bectx->bet_info[BET_AUTH].mod_name) == 0) { - DEBUG(8, ("Re-using proxy_auth_ctx for this provider\n")); + DEBUG(8, "Re-using proxy_auth_ctx for this provider\n"); *ops = bectx->bet_info[BET_AUTH].bet_ops; *pvt_data = bectx->bet_info[BET_AUTH].pvt_bet_data; return EOK; @@ -509,7 +509,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, &ctx->pam_target); if (ret != EOK) goto done; if (!ctx->pam_target) { - DEBUG(1, ("Missing option proxy_pam_target.\n")); + DEBUG(1, "Missing option proxy_pam_target.\n"); ret = EINVAL; goto done; } @@ -517,7 +517,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, sbus_address = talloc_asprintf(ctx, "unix:path=%s/%s_%s", PIPE_PATH, PROXY_CHILD_PIPE, bectx->domain->name); if (sbus_address == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -525,7 +525,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, ret = sbus_new_server(ctx, bectx->ev, sbus_address, &proxy_interface, false, &ctx->sbus_srv, proxy_client_init, ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up sbus server.\n")); + DEBUG(0, "Could not set up sbus server.\n"); goto done; } @@ -536,7 +536,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, hret = hash_create(ctx->max_children * 2, &ctx->request_table, NULL, NULL); if (hret != HASH_SUCCESS) { - DEBUG(0, ("Could not initialize request table\n")); + DEBUG(0, "Could not initialize request table\n"); ret = EIO; goto done; } diff --git a/src/providers/proxy/proxy_netgroup.c b/src/providers/proxy/proxy_netgroup.c index bb0bc171b..8aec528cf 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; } @@ -78,7 +78,7 @@ static errno_t save_netgroup(struct sysdb_ctx *sysdb, 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; } } @@ -86,7 +86,7 @@ static errno_t save_netgroup(struct sysdb_ctx *sysdb, ret = sysdb_add_netgroup(sysdb, 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; } @@ -100,27 +100,27 @@ static errno_t handle_error(enum nss_status status, struct sysdb_ctx *sysdb, 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(sysdb, 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; } @@ -144,21 +144,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, sysdb, 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; } @@ -170,15 +170,15 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx, status != NSS_STATUS_NOTFOUND) { ret = handle_error(status, sysdb, 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; } } @@ -186,7 +186,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, sysdb, dom, name); goto done; } @@ -195,7 +195,7 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx, !dom->case_sensitive, dom->netgroup_timeout); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_add_netgroup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_add_netgroup failed.\n"); goto done; } diff --git a/src/providers/proxy/proxy_services.c b/src/providers/proxy/proxy_services.c index 474959039..e5f4ff2a8 100644 --- a/src/providers/proxy/proxy_services.c +++ b/src/providers/proxy/proxy_services.c @@ -111,7 +111,7 @@ get_serv_byname(struct proxy_id_ctx *ctx, buffer, BUFLEN, &ret); if (status != NSS_STATUS_SUCCESS && status != NSS_STATUS_NOTFOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("getservbyname_r failed for service [%s].\n", name)); + "getservbyname_r failed for service [%s].\n", name); return ret; } @@ -165,7 +165,7 @@ get_serv_byport(struct proxy_id_ctx *ctx, buffer, BUFLEN, &ret); if (status != NSS_STATUS_SUCCESS && status != NSS_STATUS_NOTFOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("getservbyport_r failed for service [%s].\n", be_filter)); + "getservbyport_r failed for service [%s].\n", be_filter); return ret; } @@ -202,7 +202,7 @@ enum_services(struct proxy_id_ctx *ctx, const char **cased_aliases; bool again; - DEBUG(SSSDBG_TRACE_FUNC, ("Enumerating services\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Enumerating services\n"); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -230,7 +230,7 @@ enum_services(struct proxy_id_ctx *ctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -271,11 +271,11 @@ enum_services(struct proxy_id_ctx *ctx, case NSS_STATUS_NOTFOUND: /* we are done here */ - DEBUG(SSSDBG_TRACE_FUNC, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Enumeration completed.\n"); ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } @@ -285,8 +285,8 @@ enum_services(struct proxy_id_ctx *ctx, case NSS_STATUS_SUCCESS: DEBUG(SSSDBG_TRACE_INTERNAL, - ("Service found (%s, %d/%s)\n", - svc->s_name, svc->s_port, svc->s_proto)); + "Service found (%s, %d/%s)\n", + svc->s_name, svc->s_port, svc->s_proto); protocols[0] = sss_get_cased_name(protocols, svc->s_proto, dom->case_sensitive); @@ -303,8 +303,8 @@ enum_services(struct proxy_id_ctx *ctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to store service [%s]. Ignoring.\n", - strerror(ret))); + "Failed to store service [%s]. Ignoring.\n", + strerror(ret)); again = true; break; } @@ -321,8 +321,8 @@ enum_services(struct proxy_id_ctx *ctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to store service [%s]. Ignoring.\n", - strerror(ret))); + "Failed to store service [%s]. Ignoring.\n", + strerror(ret)); } again = true; break; @@ -335,8 +335,8 @@ enum_services(struct proxy_id_ctx *ctx, default: ret = EIO; DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getservent_r failed (%d)[%s]\n", - ret, strerror(ret))); + "proxy -> getservent_r failed (%d)[%s]\n", + ret, strerror(ret)); break; } } while (again); @@ -347,8 +347,8 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction! [%s]\n", - strerror(sret))); + "Could not cancel transaction! [%s]\n", + strerror(sret)); } } ctx->ops.endservent(); |