diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:59 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:31:02 +0100 |
commit | 83bf46f4066e3d5e838a32357c201de9bd6ecdfd (patch) | |
tree | 65f491f7661bd533398625e015f2b5e5bff3badf /src/providers/proxy | |
parent | 45a1d9d597df977354428440aeff11c6a0a947fe (diff) | |
download | sssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.tar.gz sssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.tar.xz sssd-83bf46f4066e3d5e838a32357c201de9bd6ecdfd.zip |
Update DEBUG* invocations to use new levels
Use a script to update DEBUG* macro invocations, which use literal
numbers for levels, to use bitmask macros instead:
grep -rl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e 'use strict;
use File::Slurp;
my @map=qw"
SSSDBG_FATAL_FAILURE
SSSDBG_CRIT_FAILURE
SSSDBG_OP_FAILURE
SSSDBG_MINOR_FAILURE
SSSDBG_CONF_SETTINGS
SSSDBG_FUNC_DATA
SSSDBG_TRACE_FUNC
SSSDBG_TRACE_LIBS
SSSDBG_TRACE_INTERNAL
SSSDBG_TRACE_ALL
";
my $text=read_file(\*STDIN);
my $repl;
$text=~s/
^
(
.*
\b
(DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM)
\s*
\(\s*
)(
[0-9]
)(
\s*,
)
(
\s*
)
(
.*
)
$
/
$repl = $1.$map[$3].$4.$5.$6,
length($repl) <= 80
? $repl
: $1.$map[$3].$4."\n".(" " x length($1)).$6
/xmge;
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 | 131 | ||||
-rw-r--r-- | src/providers/proxy/proxy_child.c | 79 | ||||
-rw-r--r-- | src/providers/proxy/proxy_id.c | 7 | ||||
-rw-r--r-- | src/providers/proxy/proxy_init.c | 85 | ||||
-rw-r--r-- | src/providers/proxy/proxy_netgroup.c | 9 |
5 files changed, 183 insertions, 128 deletions
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c index 27ac5c455..c2b792bd8 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(SSSDBG_CRIT_FAILURE, "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,15 @@ 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(SSSDBG_TRACE_INTERNAL, + "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(SSSDBG_CRIT_FAILURE, + "Hash error [%d][%s]\n", hret, hash_error_string(hret)); /* Nothing we can do about this, so just continue */ } return 0; @@ -132,7 +134,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(SSSDBG_CRIT_FAILURE, "Could not send PAM request to child\n"); return NULL; } @@ -156,7 +158,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(SSSDBG_FATAL_FAILURE, "Serious error: queue is too long!\n"); talloc_zfree(req); return NULL; } @@ -171,7 +173,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, hret = hash_enter(auth_ctx->request_table, &key, &value); if (hret != HASH_SUCCESS) { - DEBUG(1, "Could not add request to the queue\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not add request to the queue\n"); talloc_zfree(req); return NULL; } @@ -187,7 +189,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(SSSDBG_CRIT_FAILURE, "Could not fork child process\n"); auth_ctx->running--; talloc_zfree(req); return NULL; @@ -200,7 +202,8 @@ 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(SSSDBG_TRACE_INTERNAL, + "All available child slots are full, queuing request\n"); } return req; } @@ -234,7 +237,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(SSSDBG_CRIT_FAILURE, "Could not create tevent_req\n"); return NULL; } @@ -248,16 +251,18 @@ 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(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); return NULL; } - DEBUG(7, "Starting proxy child with args [%s]\n", state->command); + DEBUG(SSSDBG_TRACE_LIBS, + "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(SSSDBG_CRIT_FAILURE, + "fork failed [%d][%s].\n", ret, strerror(ret)); talloc_zfree(req); return NULL; } @@ -267,7 +272,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", + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not start proxy child [%s]: [%d][%s].\n", state->command, ret, strerror(ret)); _exit(1); @@ -282,7 +288,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(SSSDBG_CRIT_FAILURE, "tevent_add_signal failed.\n"); talloc_zfree(req); return NULL; } @@ -322,42 +328,50 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_TRACE_LIBS, "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(SSSDBG_CRIT_FAILURE, + "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(SSSDBG_CRIT_FAILURE, + "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, + DEBUG(SSSDBG_CONF_SETTINGS, + "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, + DEBUG(SSSDBG_CONF_SETTINGS, + "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, + DEBUG(SSSDBG_CRIT_FAILURE, + "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", + DEBUG(SSSDBG_CRIT_FAILURE, + "child [%d] was resumed by delivery of SIGCONT.\n", ret); } - DEBUG(1, "Child is still running, no new child is started.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Child is still running, no new child is started.\n"); return; } } @@ -369,7 +383,7 @@ static void pc_init_timeout(struct tevent_context *ev, { struct tevent_req *req; - DEBUG(2, "Client timed out before Identification!\n"); + DEBUG(SSSDBG_OP_FAILURE, "Client timed out before Identification!\n"); req = talloc_get_type(ptr, struct tevent_req); tevent_req_error(req, ETIMEDOUT); } @@ -421,7 +435,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(SSSDBG_TRACE_FUNC, "Proxy child init failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -431,7 +445,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(SSSDBG_CRIT_FAILURE,"Could not start PAM conversation\n"); tevent_req_error(req, EIO); return; } @@ -443,7 +457,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(SSSDBG_CRIT_FAILURE, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -456,7 +470,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(SSSDBG_CRIT_FAILURE, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -485,44 +499,52 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_TRACE_LIBS, "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(SSSDBG_CRIT_FAILURE, + "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(SSSDBG_CRIT_FAILURE, + "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, + DEBUG(SSSDBG_CONF_SETTINGS, + "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, + DEBUG(SSSDBG_CONF_SETTINGS, + "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, + DEBUG(SSSDBG_CRIT_FAILURE, + "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", + DEBUG(SSSDBG_CRIT_FAILURE, + "child [%d] was resumed by delivery of SIGCONT.\n", ret); } - DEBUG(1, "Child is still running, no new child is started.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "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(SSSDBG_CRIT_FAILURE, "tevent_create_immediate failed.\n"); return; } @@ -532,7 +554,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(SSSDBG_CRIT_FAILURE, "tevent_create_immediate failed.\n"); return; } @@ -583,17 +605,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(SSSDBG_CRIT_FAILURE, "dbus_message_new_method_call failed.\n"); talloc_zfree(req); return NULL; } - DEBUG(4, "Sending request with the following data:\n"); - DEBUG_PAM_DATA(4, pd); + DEBUG(SSSDBG_CONF_SETTINGS, "Sending request with the following data:\n"); + DEBUG_PAM_DATA(SSSDBG_CONF_SETTINGS, pd); dp_ret = dp_pack_pam_request(msg, pd); if (!dp_ret) { - DEBUG(1, "Failed to build message\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); dbus_message_unref(msg); talloc_zfree(req); return NULL; @@ -620,7 +642,7 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) int type; int ret; - DEBUG(8, "Handling pam conversation reply\n"); + DEBUG(SSSDBG_TRACE_INTERNAL, "Handling pam conversation reply\n"); req = talloc_get_type(ptr, struct tevent_req); state = tevent_req_data(req, struct proxy_conv_ctx); @@ -630,7 +652,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" + DEBUG(SSSDBG_FATAL_FAILURE, + "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 +664,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(SSSDBG_FATAL_FAILURE, "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(SSSDBG_CONF_SETTINGS, "received: [%d][%s]\n", state->pd->pam_status, state->pd->domain); break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0, "Reply error [%s].\n", + DEBUG(SSSDBG_FATAL_FAILURE, "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(SSSDBG_FATAL_FAILURE, "Default... what now?.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; } dbus_message_unref(reply); @@ -686,7 +709,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(SSSDBG_TRACE_FUNC, "Proxy PAM conversation failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -725,7 +748,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(SSSDBG_CRIT_FAILURE, "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 +776,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(SSSDBG_OP_FAILURE, "Failed to cache password\n"); goto done; } @@ -762,7 +785,7 @@ 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", + DEBUG(SSSDBG_OP_FAILURE, "Failed to cache password (%d)[%s]!?\n", ret, strerror(ret)); } } @@ -807,7 +830,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(SSSDBG_CRIT_FAILURE, "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 6e93bec63..52968651b 100644 --- a/src/providers/proxy/proxy_child.c +++ b/src/providers/proxy/proxy_child.c @@ -95,7 +95,8 @@ 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(SSSDBG_CONF_SETTINGS, + "Conversation message: [%s]\n", msgm[i]->msg); reply[i].resp_retcode = 0; ret = sss_authtok_get_password(auth_data->authtok, @@ -107,7 +108,8 @@ static int proxy_internal_conv(int num_msg, const struct pam_message **msgm, break; default: - DEBUG(1, "Conversation style %d not supported.\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Conversation style %d not supported.\n", msgm[i]->msg_style); goto failed; } @@ -144,7 +146,8 @@ 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(SSSDBG_CONF_SETTINGS, + "Conversation message: [%s]\n", msgm[i]->msg); reply[i].resp_retcode = 0; if (!auth_data->sent_old) { @@ -170,7 +173,8 @@ static int proxy_chauthtok_conv(int num_msg, const struct pam_message **msgm, break; default: - DEBUG(1, "Conversation style %d not supported.\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Conversation style %d not supported.\n", msgm[i]->msg_style); goto failed; } @@ -222,21 +226,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", + DEBUG(SSSDBG_TRACE_LIBS, + "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", + DEBUG(SSSDBG_CRIT_FAILURE, "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", + DEBUG(SSSDBG_CRIT_FAILURE, "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", + DEBUG(SSSDBG_CRIT_FAILURE, "Setting PAM_RHOST failed: %s.\n", pam_strerror(pamh, ret)); } switch (pd->cmd) { @@ -275,21 +280,21 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) } break; default: - DEBUG(1, "unknown PAM call\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "unknown PAM call\n"); pam_status=PAM_ABORT; } - DEBUG(4, "Pam result: [%d][%s]\n", pam_status, + DEBUG(SSSDBG_CONF_SETTINGS, "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(SSSDBG_CRIT_FAILURE, "Cannot terminate pam transaction.\n"); } } else { - DEBUG(1, "Failed to initialize pam transaction.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to initialize pam transaction.\n"); pam_status = PAM_SYSTEM_ERR; } @@ -323,7 +328,7 @@ 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, " + DEBUG(SSSDBG_CRIT_FAILURE, "dbus_message_new_method_return failed, " "cannot send reply.\n"); ret = ENOMEM; goto done; @@ -333,7 +338,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(SSSDBG_CRIT_FAILURE,"Failed, to parse message!\n"); ret = EIO; goto done; } @@ -346,20 +351,20 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn) goto done; } - DEBUG(4, "Got request with the following data\n"); - DEBUG_PAM_DATA(4, pd); + DEBUG(SSSDBG_CONF_SETTINGS, "Got request with the following data\n"); + DEBUG_PAM_DATA(SSSDBG_CONF_SETTINGS, pd); ret = call_pam_stack(pc_ctx->pam_target, pd); if (ret != EOK) { - DEBUG(1, "call_pam_stack failed.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "call_pam_stack failed.\n"); } - DEBUG(4, "Sending result [%d][%s]\n", + DEBUG(SSSDBG_CONF_SETTINGS, "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(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); talloc_free(pd); dbus_message_unref(reply); ret = EIO; @@ -391,7 +396,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(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); return ENOMEM; } @@ -399,13 +404,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(SSSDBG_CRIT_FAILURE, "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(SSSDBG_FATAL_FAILURE, "dp_common_send_id failed.\n"); return ret; } @@ -426,7 +431,7 @@ int proxy_child_send_id(struct sbus_connection *conn, DP_INTERFACE, DP_METHOD_REGISTER); if (msg == NULL) { - DEBUG(0, "Out of memory?!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?!\n"); return ENOMEM; } @@ -438,7 +443,7 @@ int proxy_child_send_id(struct sbus_connection *conn, DBUS_TYPE_UINT32, &id, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, "Failed to build message\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); return EIO; } @@ -457,7 +462,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(SSSDBG_FATAL_FAILURE, "fatal error initializing pc_ctx\n"); return ENOMEM; } ctx->ev = ev; @@ -466,19 +471,20 @@ 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(SSSDBG_FATAL_FAILURE, "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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_FATAL_FAILURE, "fatal error setting up server bus\n"); return ret; } @@ -551,43 +557,46 @@ 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(SSSDBG_FATAL_FAILURE, "Could not set up mainloop [%d]\n", ret); return 2; } ret = unsetenv("_SSS_LOOPS"); if (ret != EOK) { - DEBUG(1, "Failed to unset _SSS_LOOPS, " + DEBUG(SSSDBG_CRIT_FAILURE, "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", + DEBUG(SSSDBG_FATAL_FAILURE, "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(SSSDBG_CRIT_FAILURE, "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(SSSDBG_OP_FAILURE, + "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(SSSDBG_FATAL_FAILURE, + "Could not initialize proxy child [%d].\n", ret); return 3; } - DEBUG(1, "Proxy child for domain [%s] started!\n", domain); + DEBUG(SSSDBG_CRIT_FAILURE, + "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 3bcbdd44c..f78c4c630 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -536,7 +536,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, return ENOMEM; } - DEBUG_GR_MEM(7, grp); + DEBUG_GR_MEM(SSSDBG_TRACE_LIBS, grp); ret = sysdb_transaction_start(sysdb); if (ret != EOK) { @@ -1330,7 +1330,7 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx, break; default: - DEBUG(2, "proxy -> initgroups_dyn failed (%d)[%s]\n", + DEBUG(SSSDBG_OP_FAILURE, "proxy -> initgroups_dyn failed (%d)[%s]\n", ret, strerror(ret)); ret = EIO; break; @@ -1489,7 +1489,8 @@ void proxy_get_account_info(struct be_req *breq) if (ret) { if (ret == ENXIO) { - DEBUG(2, "proxy returned UNAVAIL error, going offline!\n"); + DEBUG(SSSDBG_OP_FAILURE, + "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 f2ad14475..ae73fe702 100644 --- a/src/providers/proxy/proxy_init.c +++ b/src/providers/proxy/proxy_init.c @@ -125,7 +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", + DEBUG(SSSDBG_FATAL_FAILURE, + "Unable to load %s module with path, error: %s\n", libpath, dlerror()); ret = ELIBACC; goto done; @@ -134,7 +135,8 @@ 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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -142,14 +144,16 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -157,14 +161,16 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -172,7 +178,8 @@ 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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -180,14 +187,16 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -195,14 +204,16 @@ 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(SSSDBG_FATAL_FAILURE, + "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(SSSDBG_FATAL_FAILURE, + "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -210,7 +221,7 @@ 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(SSSDBG_CRIT_FAILURE, "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); @@ -219,7 +230,8 @@ int sssm_proxy_id_init(struct be_ctx *bectx, 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(SSSDBG_FATAL_FAILURE, + "Failed to load _nss_%s_setnetgrent, error: %s. " "The library does not support netgroups.\n", libname, dlerror()); } @@ -227,7 +239,8 @@ int sssm_proxy_id_init(struct be_ctx *bectx, 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(SSSDBG_FATAL_FAILURE, + "Failed to load _nss_%s_getnetgrent_r, error: %s. " "The library does not support netgroups.\n", libname, dlerror()); } @@ -235,7 +248,8 @@ int sssm_proxy_id_init(struct be_ctx *bectx, 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(SSSDBG_FATAL_FAILURE, + "Failed to load _nss_%s_endnetgrent, error: %s. " "The library does not support netgroups.\n", libname, dlerror()); } @@ -329,7 +343,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(SSSDBG_FATAL_FAILURE,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -343,11 +357,12 @@ 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(SSSDBG_FATAL_FAILURE,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } - DEBUG(4, "Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout); + DEBUG(SSSDBG_CONF_SETTINGS, + "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 +377,8 @@ static void init_timeout(struct tevent_context *ev, { struct proxy_client *proxy_cli; - DEBUG(2, "Client timed out before Identification [%p]!\n", te); + DEBUG(SSSDBG_OP_FAILURE, + "Client timed out before Identification [%p]!\n", te); proxy_cli = talloc_get_type(ptr, struct proxy_client); @@ -396,12 +412,13 @@ 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(SSSDBG_FATAL_FAILURE, "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(SSSDBG_CONF_SETTINGS, + "Cancel proxy client ID timeout [%p]\n", proxy_cli->timeout); talloc_zfree(proxy_cli->timeout); dbus_error_init(&dbus_error); @@ -411,7 +428,8 @@ 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(SSSDBG_CRIT_FAILURE, + "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) ? */ @@ -424,7 +442,8 @@ static int client_registration(DBusMessage *message, 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(SSSDBG_CRIT_FAILURE, + "Unknown child ID. Killing the connection\n"); sbus_disconnect(proxy_cli->conn); return EIO; } @@ -432,7 +451,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(SSSDBG_FATAL_FAILURE, "Dbus Out of memory!\n"); return ENOMEM; } @@ -440,7 +459,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(SSSDBG_FATAL_FAILURE, "Failed to build dbus reply\n"); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -452,7 +471,8 @@ 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(SSSDBG_CRIT_FAILURE, + "Hash error [%d][%s]\n", hret, hash_error_string(hret)); sbus_disconnect(conn); } @@ -466,7 +486,7 @@ static int client_registration(DBusMessage *message, * the init_req will be NULL below and things will * break. */ - DEBUG(1, "Client connection from a request " + DEBUG(SSSDBG_CRIT_FAILURE, "Client connection from a request " "that's not marked as running\n"); return EIO; } @@ -490,7 +510,8 @@ 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(SSSDBG_TRACE_INTERNAL, + "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 +530,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(SSSDBG_CRIT_FAILURE, "Missing option proxy_pam_target.\n"); ret = EINVAL; goto done; } @@ -517,7 +538,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(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -525,7 +546,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(SSSDBG_FATAL_FAILURE, "Could not set up sbus server.\n"); goto done; } @@ -536,7 +557,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(SSSDBG_FATAL_FAILURE, "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 c799e284c..566af7479 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(SSSDBG_CRIT_FAILURE, "sysdb_attrs_add_string failed.\n"); return ret; } } else if (netgrent.type == triple_val) { @@ -49,17 +49,18 @@ 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(SSSDBG_CRIT_FAILURE, "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(SSSDBG_CRIT_FAILURE, "sysdb_attrs_add_string failed.\n"); return ret; } } else { - DEBUG(1, "Unknown netgrent entry type [%d].\n", netgrent.type); + DEBUG(SSSDBG_CRIT_FAILURE, + "Unknown netgrent entry type [%d].\n", netgrent.type); return EINVAL; } |