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/responder/nss | |
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/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv.c | 28 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 204 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_netgroup.c | 94 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_private.h | 4 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_services.c | 2 |
5 files changed, 206 insertions, 126 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c index 685ebeb35..9d0c9969a 100644 --- a/src/responder/nss/nsssrv.c +++ b/src/responder/nss/nsssrv.c @@ -181,13 +181,14 @@ static errno_t nss_get_etc_shells(TALLOC_CTX *mem_ctx, char ***_shells) ret = ENOMEM; goto done; } - DEBUG(6, "Found shell %s in /etc/shells\n", shells[i]); + DEBUG(SSSDBG_TRACE_FUNC, "Found shell %s in /etc/shells\n", shells[i]); i++; if (i == size) { size += SHELL_REALLOC_INCREMENT; if (size > SHELL_REALLOC_MAX) { - DEBUG(0, "Reached maximum number of shells [%d]. " + DEBUG(SSSDBG_FATAL_FAILURE, + "Reached maximum number of shells [%d]. " "Users may be denied access. " "Please check /etc/shells for sanity\n", SHELL_REALLOC_MAX); @@ -245,7 +246,8 @@ static int nss_get_config(struct nss_ctx *nctx, if (ret != EOK) goto done; if (nctx->cache_refresh_percent < 0 || nctx->cache_refresh_percent > 99) { - DEBUG(0,"Configuration error: entry_cache_nowait_percentage is " + DEBUG(SSSDBG_FATAL_FAILURE, + "Configuration error: entry_cache_nowait_percentage is " "invalid. Disabling feature.\n"); nctx->cache_refresh_percent = 0; } @@ -393,7 +395,7 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn, /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(1, "Reconnected to the Data Provider.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Reconnected to the Data Provider.\n"); /* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -407,7 +409,7 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn, } /* Failed to reconnect */ - DEBUG(0, "Could not reconnect to %s provider.\n", + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n", be_conn->domain->name); /* FIXME: kill the frontend and let the monitor restart it ? */ @@ -446,14 +448,15 @@ int nss_process_init(TALLOC_CTX *mem_ctx, nctx = talloc_zero(rctx, struct nss_ctx); if (!nctx) { - DEBUG(0, "fatal error initializing nss_ctx\n"); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing nss_ctx\n"); ret = ENOMEM; goto fail; } ret = sss_ncache_init(rctx, &nctx->ncache); if (ret != EOK) { - DEBUG(0, "fatal error initializing negative cache\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "fatal error initializing negative cache\n"); goto fail; } @@ -462,7 +465,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, ret = nss_get_config(nctx, cdb); if (ret != EOK) { - DEBUG(0, "fatal error getting nss config\n"); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error getting nss config\n"); goto fail; } @@ -472,7 +475,8 @@ int nss_process_init(TALLOC_CTX *mem_ctx, CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries); if (ret != EOK) { - DEBUG(0, "Failed to set up automatic reconnection\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Failed to set up automatic reconnection\n"); goto fail; } @@ -493,7 +497,8 @@ int nss_process_init(TALLOC_CTX *mem_ctx, hret = sss_hash_create_ex(nctx, 10, &nctx->netgroups, 0, 0, 0, 0, netgroup_hash_delete_cb, NULL); if (hret != HASH_SUCCESS) { - DEBUG(0,"Unable to initialize netgroup hash table\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Unable to initialize netgroup hash table\n"); ret = EIO; goto fail; } @@ -608,7 +613,8 @@ int main(int argc, const char *argv[]) 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 = nss_process_init(main_ctx, diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index ae21f1f92..e91093561 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -252,7 +252,7 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->vetoed_shells) { for (i=0; nctx->vetoed_shells[i]; i++) { if (strcmp(nctx->vetoed_shells[i], user_shell) == 0) { - DEBUG(5, "The shell '%s' is vetoed. " + DEBUG(SSSDBG_FUNC_DATA, "The shell '%s' is vetoed. " "Using fallback\n", user_shell); return talloc_strdup(mem_ctx, nctx->shell_fallback); } @@ -262,14 +262,14 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->etc_shells) { for (i=0; nctx->etc_shells[i]; i++) { if (strcmp(user_shell, nctx->etc_shells[i]) == 0) { - DEBUG(9, "Shell %s found in /etc/shells\n", + DEBUG(SSSDBG_TRACE_ALL, "Shell %s found in /etc/shells\n", nctx->etc_shells[i]); break; } } if (nctx->etc_shells[i]) { - DEBUG(9, "Using original shell '%s'\n", user_shell); + DEBUG(SSSDBG_TRACE_ALL, "Using original shell '%s'\n", user_shell); return talloc_strdup(mem_ctx, user_shell); } } @@ -277,14 +277,16 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->allowed_shells) { for (i=0; nctx->allowed_shells[i]; i++) { if (strcmp(nctx->allowed_shells[i], user_shell) == 0) { - DEBUG(5, "The shell '%s' is allowed but does not exist. " + DEBUG(SSSDBG_FUNC_DATA, + "The shell '%s' is allowed but does not exist. " "Using fallback\n", user_shell); return talloc_strdup(mem_ctx, nctx->shell_fallback); } } } - DEBUG(5, "The shell '%s' is not allowed and does not exist.\n", + DEBUG(SSSDBG_FUNC_DATA, + "The shell '%s' is not allowed and does not exist.\n", user_shell); return talloc_strdup(mem_ctx, NOLOGIN_SHELL); } @@ -411,7 +413,8 @@ static int fill_pwent(struct sss_packet *packet, if (add_domain) { ret = sss_fqname((char *) &body[rp], fq_len, dom->names, dom, name.str); if (ret < 0 || ret != fq_len - 1) { - DEBUG(1, "Failed to generate a fully qualified name for user " + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to generate a fully qualified name for user " "[%s] in [%s]! Skipping user.\n", name.str, domain); continue; } @@ -514,7 +517,8 @@ errno_t check_cache(struct nss_dom_ctx *dctx, */ if ((req_type == SSS_DP_USER || req_type == SSS_DP_NETGR) && (res->count > 1)) { - DEBUG(1, "getpwXXX call returned more than one result!" + DEBUG(SSSDBG_CRIT_FAILURE, + "getpwXXX call returned more than one result!" " DB Corrupted?\n"); return ENOENT; } @@ -747,21 +751,25 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) return ENOENT; } - DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Requesting info for [%s@%s]\n", name, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } ret = sysdb_getpwnam(cmdctx, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache!\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache!\n"); return EIO; } if (dctx->res->count > 1) { - DEBUG(0, "getpwnam call returned more than one result !?!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "getpwnam call returned more than one result !?!\n"); return ENOENT; } @@ -779,7 +787,7 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) if (dom) continue; } - DEBUG(2, "No results for getpwnam call\n"); + DEBUG(SSSDBG_OP_FAILURE, "No results for getpwnam call\n"); /* User not found in ldb -> delete user from memory cache. */ ret = delete_entry_from_memcache(dctx->domain, name, @@ -808,7 +816,8 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) } /* One result found */ - DEBUG(6, "Returning info for user [%s@%s]\n", name, dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Returning info for user [%s@%s]\n", name, dom->name); return EOK; } @@ -838,7 +847,8 @@ static void nss_cmd_getby_dp_callback(uint16_t err_maj, uint32_t err_min, bool check_subdomains; if (err_maj) { - DEBUG(2, "Unable to get information from Data Provider\n" + DEBUG(SSSDBG_OP_FAILURE, + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, err_msg); @@ -1135,7 +1145,7 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx) goto done; } - DEBUG(4, "Requesting info for [%s] from [%s]\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for [%s] from [%s]\n", cmdctx->name, domname?domname:"<ALL>"); if (domname) { @@ -1306,7 +1316,8 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) /* check that the uid is valid for this domain */ if ((dom->id_min && (cmdctx->id < dom->id_min)) || (dom->id_max && (cmdctx->id > dom->id_max))) { - DEBUG(4, "Uid [%"PRIu32"] does not exist in domain [%s]! " + DEBUG(SSSDBG_CONF_SETTINGS, + "Uid [%"PRIu32"] does not exist in domain [%s]! " "(id out of range)\n", cmdctx->id, dom->name); if (cmdctx->check_next) { @@ -1326,23 +1337,27 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom; - DEBUG(4, "Requesting info for [%"PRIu32"@%s]\n", cmdctx->id, dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Requesting info for [%"PRIu32"@%s]\n", cmdctx->id, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); ret = EIO; goto done; } ret = sysdb_getpwuid(cmdctx, dom, cmdctx->id, &dctx->res); if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache!\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache!\n"); ret = EIO; goto done; } if (dctx->res->count > 1) { - DEBUG(0, "getpwuid call returned more than one result !?!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "getpwuid call returned more than one result !?!\n"); ret = ENOENT; goto done; } @@ -1376,7 +1391,8 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) } /* One result found */ - DEBUG(6, "Returning info for uid [%"PRIu32"@%s]\n", cmdctx->id, dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Returning info for uid [%"PRIu32"@%s]\n", cmdctx->id, dom->name); ret = EOK; goto done; @@ -1642,7 +1658,8 @@ static int nss_cmd_setpwent(struct cli_ctx *cctx) req = nss_cmd_setpwent_send(cmdctx, cctx); if (!req) { - DEBUG(0, "Fatal error calling nss_cmd_setpwent_send\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal error calling nss_cmd_setpwent_send\n"); ret = EIO; goto done; } @@ -1663,7 +1680,7 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom; struct setent_step_ctx *step_ctx; - DEBUG(4, "Received setpwent request\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Received setpwent request\n"); nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx); /* Reset the read pointers */ @@ -1672,7 +1689,8 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct setent_ctx); if (!req) { - DEBUG(0, "Could not create tevent request for setpwent\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not create tevent request for setpwent\n"); return NULL; } @@ -1692,7 +1710,7 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx, state->dctx->domain = dom; if (state->dctx->domain == NULL) { - DEBUG(2, "Enumeration disabled on all domains!\n"); + DEBUG(SSSDBG_OP_FAILURE, "Enumeration disabled on all domains!\n"); ret = ENOENT; goto error; } @@ -1812,10 +1830,12 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom; - DEBUG(6, "Requesting info for domain [%s]\n", dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Requesting info for domain [%s]\n", dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } @@ -1853,14 +1873,16 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) ret = sysdb_enumpwent(dctx, dom, &res); if (ret != EOK) { - DEBUG(1, "Enum from cache failed, skipping domain [%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Enum from cache failed, skipping domain [%s]\n", dom->name); dom = get_next_domain(dom, true); continue; } if (res->count == 0) { - DEBUG(4, "Domain [%s] has no users, skipping.\n", dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Domain [%s] has no users, skipping.\n", dom->name); dom = get_next_domain(dom, true); continue; } @@ -1895,7 +1917,8 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) te = tevent_add_timer(rctx->ev, nctx->pctx, tv, setpwent_result_timeout, nctx); if (!te) { - DEBUG(0, "Could not set up life timer for setpwent result object. " + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not set up life timer for setpwent result object. " "Entries may become stale.\n"); } @@ -1916,7 +1939,8 @@ static void setpwent_result_timeout(struct tevent_context *ev, { struct nss_ctx *nctx = talloc_get_type(pvt, struct nss_ctx); - DEBUG(1, "setpwent result object has expired. Cleaning up.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "setpwent result object has expired. Cleaning up.\n"); /* Free the passwd enumeration context. * If additional getpwent requests come in, they will invoke @@ -1933,7 +1957,8 @@ static void nss_cmd_setpwent_dp_callback(uint16_t err_maj, uint32_t err_min, int ret; if (err_maj) { - DEBUG(2, "Unable to get information from Data Provider\n" + DEBUG(SSSDBG_OP_FAILURE, + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, err_msg); @@ -1982,7 +2007,7 @@ static int nss_cmd_getpwent(struct cli_ctx *cctx) struct nss_cmd_ctx *cmdctx; struct tevent_req *req; - DEBUG(4, "Requesting info for all accounts\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for all accounts\n"); cmdctx = talloc_zero(cctx, struct nss_cmd_ctx); if (!cmdctx) { @@ -2114,7 +2139,8 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req) * later. */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, "Implicit setpwent failed with unexpected error [%d][%s]\n", + DEBUG(SSSDBG_FATAL_FAILURE, + "Implicit setpwent failed with unexpected error [%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -2125,7 +2151,8 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req) ret = nss_cmd_getpwent_immediate(cmdctx); if (ret != EOK) { - DEBUG(0, "Immediate retrieval failed with unexpected error " + DEBUG(SSSDBG_FATAL_FAILURE, + "Immediate retrieval failed with unexpected error " "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -2136,7 +2163,7 @@ static int nss_cmd_endpwent(struct cli_ctx *cctx) struct nss_ctx *nctx; int ret; - DEBUG(4, "Terminating request info for all accounts\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Terminating request info for all accounts\n"); nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx); @@ -2422,7 +2449,7 @@ static int fill_grent(struct sss_packet *packet, /* new group */ if (!ldb_msg_check_string_attribute(msg, "objectClass", SYSDB_GROUP_CLASS)) { - DEBUG(1, "Wrong object (%s) found on stack!\n", + DEBUG(SSSDBG_CRIT_FAILURE, "Wrong object (%s) found on stack!\n", ldb_dn_get_linearized(msg->dn)); continue; } @@ -2435,7 +2462,8 @@ static int fill_grent(struct sss_packet *packet, orig_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); if (!orig_name || !gid) { - DEBUG(2, "Incomplete group object for %s[%llu]! Skipping\n", + DEBUG(SSSDBG_OP_FAILURE, + "Incomplete group object for %s[%llu]! Skipping\n", orig_name?orig_name:"<NULL>", (unsigned long long int)gid); continue; } @@ -2492,7 +2520,8 @@ static int fill_grent(struct sss_packet *packet, ret = sss_fqname((char *)&body[rzero+STRS_ROFFSET], fq_len, dom->names, dom, name.str); if (ret < 0 || ret != fq_len - 1) { - DEBUG(1, "Failed to generate a fully qualified name for" + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to generate a fully qualified name for" " group [%s] in [%s]! Skipping\n", name.str, domain); /* reclaim space */ ret = sss_packet_shrink(packet, rsize); @@ -2671,21 +2700,25 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) return ENOENT; } - DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Requesting info for [%s@%s]\n", name, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } ret = sysdb_getgrnam(cmdctx, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache!\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache!\n"); return EIO; } if (dctx->res->count > 1) { - DEBUG(0, "getgrnam call returned more than one result !?!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "getgrnam call returned more than one result !?!\n"); return ENOENT; } @@ -2703,7 +2736,7 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) if (dom) continue; } - DEBUG(2, "No results for getgrnam call\n"); + DEBUG(SSSDBG_OP_FAILURE, "No results for getgrnam call\n"); /* Group not found in ldb -> delete group from memory cache. */ ret = delete_entry_from_memcache(dctx->domain, name, @@ -2733,7 +2766,8 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) } /* One result found */ - DEBUG(6, "Returning info for group [%s@%s]\n", name, dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Returning info for group [%s@%s]\n", name, dom->name); return EOK; } @@ -2772,7 +2806,8 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) /* check that the gid is valid for this domain */ if ((dom->id_min && (cmdctx->id < dom->id_min)) || (dom->id_max && (cmdctx->id > dom->id_max))) { - DEBUG(4, "Gid [%"PRIu32"] does not exist in domain [%s]! " + DEBUG(SSSDBG_CONF_SETTINGS, + "Gid [%"PRIu32"] does not exist in domain [%s]! " "(id out of range)\n", cmdctx->id, dom->name); if (cmdctx->check_next) { @@ -2792,23 +2827,27 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom; - DEBUG(4, "Requesting info for [%"PRIu32"@%s]\n", cmdctx->id, dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Requesting info for [%"PRIu32"@%s]\n", cmdctx->id, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); ret = EIO; goto done; } ret = sysdb_getgrgid(cmdctx, dom, cmdctx->id, &dctx->res); if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache!\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache!\n"); ret = EIO; goto done; } if (dctx->res->count > 1) { - DEBUG(0, "getgrgid call returned more than one result !?!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "getgrgid call returned more than one result !?!\n"); ret = ENOENT; goto done; } @@ -2842,7 +2881,8 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) } /* One result found */ - DEBUG(6, "Returning info for gid [%"PRIu32"@%s]\n", cmdctx->id, dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Returning info for gid [%"PRIu32"@%s]\n", cmdctx->id, dom->name); /* Success. Break from the loop and return EOK */ ret = EOK; @@ -2898,7 +2938,8 @@ static int nss_cmd_setgrent(struct cli_ctx *cctx) req = nss_cmd_setgrent_send(cmdctx, cctx); if (!req) { - DEBUG(0, "Fatal error calling nss_cmd_setgrent_send\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal error calling nss_cmd_setgrent_send\n"); ret = EIO; goto done; } @@ -2919,7 +2960,7 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom; struct setent_step_ctx *step_ctx; - DEBUG(4, "Received setgrent request\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Received setgrent request\n"); nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx); /* Reset the read pointers */ @@ -2928,7 +2969,8 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct setent_ctx); if (!req) { - DEBUG(0, "Could not create tevent request for setgrent\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not create tevent request for setgrent\n"); return NULL; } @@ -2948,7 +2990,7 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx, state->dctx->domain = dom; if (state->dctx->domain == NULL) { - DEBUG(2, "Enumeration disabled on all domains!\n"); + DEBUG(SSSDBG_OP_FAILURE, "Enumeration disabled on all domains!\n"); ret = ENOENT; goto error; } @@ -3068,10 +3110,12 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom; - DEBUG(6, "Requesting info for domain [%s]\n", dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Requesting info for domain [%s]\n", dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } @@ -3109,14 +3153,16 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) ret = sysdb_enumgrent(dctx, dom, &res); if (ret != EOK) { - DEBUG(1, "Enum from cache failed, skipping domain [%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Enum from cache failed, skipping domain [%s]\n", dom->name); dom = get_next_domain(dom, true); continue; } if (res->count == 0) { - DEBUG(4, "Domain [%s] has no groups, skipping.\n", dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Domain [%s] has no groups, skipping.\n", dom->name); dom = get_next_domain(dom, true); continue; } @@ -3151,7 +3197,8 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) te = tevent_add_timer(rctx->ev, nctx->gctx, tv, setgrent_result_timeout, nctx); if (!te) { - DEBUG(0, "Could not set up life timer for setgrent result object. " + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not set up life timer for setgrent result object. " "Entries may become stale.\n"); } @@ -3173,7 +3220,8 @@ static void setgrent_result_timeout(struct tevent_context *ev, { struct nss_ctx *nctx = talloc_get_type(pvt, struct nss_ctx); - DEBUG(1, "setgrent result object has expired. Cleaning up.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "setgrent result object has expired. Cleaning up.\n"); /* Free the group enumeration context. * If additional getgrent requests come in, they will invoke @@ -3190,7 +3238,8 @@ static void nss_cmd_setgrent_dp_callback(uint16_t err_maj, uint32_t err_min, int ret; if (err_maj) { - DEBUG(2, "Unable to get information from Data Provider\n" + DEBUG(SSSDBG_OP_FAILURE, + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, err_msg); @@ -3317,7 +3366,7 @@ static int nss_cmd_getgrent(struct cli_ctx *cctx) struct nss_cmd_ctx *cmdctx; struct tevent_req *req; - DEBUG(4, "Requesting info for all groups\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for all groups\n"); cmdctx = talloc_zero(cctx, struct nss_cmd_ctx); if (!cmdctx) { @@ -3363,7 +3412,8 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req) * later. */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, "Implicit setgrent failed with unexpected error [%d][%s]\n", + DEBUG(SSSDBG_FATAL_FAILURE, + "Implicit setgrent failed with unexpected error [%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -3374,7 +3424,8 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req) ret = nss_cmd_getgrent_immediate(cmdctx); if (ret != EOK) { - DEBUG(0, "Immediate retrieval failed with unexpected error " + DEBUG(SSSDBG_FATAL_FAILURE, + "Immediate retrieval failed with unexpected error " "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -3385,7 +3436,7 @@ static int nss_cmd_endgrent(struct cli_ctx *cctx) struct nss_ctx *nctx; int ret; - DEBUG(4, "Terminating request info for all groups\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Terminating request info for all groups\n"); nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx); @@ -3564,7 +3615,8 @@ static int fill_initgr(struct sss_packet *packet, struct ldb_result *res) skipped++; continue; } else { - DEBUG(1, "Incomplete group object for initgroups! Aborting\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Incomplete group object for initgroups! Aborting\n"); return EFAULT; } } @@ -3671,16 +3723,19 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) return ENOENT; } - DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name); + DEBUG(SSSDBG_CONF_SETTINGS, + "Requesting info for [%s@%s]\n", name, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } ret = sysdb_initgroups(cmdctx, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache! [%d][%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache! [%d][%s]\n", ret, strerror(ret)); return EIO; } @@ -3699,7 +3754,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) if (dom) continue; } - DEBUG(2, "No results for initgroups call\n"); + DEBUG(SSSDBG_OP_FAILURE, "No results for initgroups call\n"); return ENOENT; } @@ -3719,7 +3774,8 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) } } - DEBUG(6, "Initgroups for [%s@%s] completed\n", name, dom->name); + DEBUG(SSSDBG_TRACE_FUNC, + "Initgroups for [%s@%s] completed\n", name, dom->name); return EOK; } @@ -4059,7 +4115,7 @@ static errno_t nss_cmd_getbysid_search(struct nss_dom_ctx *dctx) } if (dctx->res->count == 0 && !dctx->check_provider) { - DEBUG(2, "No results for getbysid call.\n"); + DEBUG(SSSDBG_OP_FAILURE, "No results for getbysid call.\n"); /* set negative cache only if not result of cache check */ ret = sss_ncache_set_sid(nctx->ncache, false, cmdctx->secid); @@ -4473,7 +4529,7 @@ static int nss_cmd_getbysid(enum sss_cli_command cmd, struct cli_ctx *cctx) goto done; } - DEBUG(4, "Requesting info for [%s] from [%s]\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for [%s] from [%s]\n", cmdctx->secid, dctx->domain->name); dctx->check_provider = NEED_CHECK_PROVIDER(dctx->domain->provider); diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index 469445f88..c269309f5 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -50,7 +50,8 @@ static errno_t get_netgroup_entry(struct nss_ctx *nctx, return ENOENT; } - DEBUG(1, "Unexpected error reading from netgroup hash [%d][%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, + "Unexpected error reading from netgroup hash [%d][%s]\n", hret, hash_error_string(hret)); return EIO; } @@ -64,7 +65,7 @@ static errno_t set_netgroup_entry(struct nss_ctx *nctx, int hret; if (netgr->name == NULL) { - DEBUG(1, "Missing netgroup name.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing netgroup name.\n"); return EINVAL; } /* Add this entry to the hash table */ @@ -74,8 +75,10 @@ static errno_t set_netgroup_entry(struct nss_ctx *nctx, value.ptr = netgr; hret = hash_enter(nctx->netgroups, &key, &value); if (hret != EOK) { - DEBUG(0, "Unable to add hash table entry for [%s]", key.str); - DEBUG(4, "Hash error [%d][%s]", hret, hash_error_string(hret)); + DEBUG(SSSDBG_FATAL_FAILURE, + "Unable to add hash table entry for [%s]", key.str); + DEBUG(SSSDBG_CONF_SETTINGS, + "Hash error [%d][%s]", hret, hash_error_string(hret)); return EIO; } talloc_steal(nctx->netgroups, netgr); @@ -125,7 +128,7 @@ int nss_cmd_setnetgrent(struct cli_ctx *client) req = setnetgrent_send(cmdctx, rawname, cmdctx); if (!req) { - DEBUG(0, "Fatal error calling setnetgrent_send\n"); + DEBUG(SSSDBG_FATAL_FAILURE, "Fatal error calling setnetgrent_send\n"); ret = EIO; goto done; } @@ -154,7 +157,8 @@ static int netgr_hash_remove (TALLOC_CTX *ctx) /* Remove the netgroup result object from the lookup table */ hret = hash_delete(netgr->lookup_table, &key); if (hret != HASH_SUCCESS) { - DEBUG(0, "Could not remove key [%s] from table! [%d][%s]\n", + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not remove key [%s] from table! [%d][%s]\n", netgr->name, hret, hash_error_string(hret)); return -1; } @@ -187,7 +191,8 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct setnetgrent_ctx); if (!req) { - DEBUG(0, "Could not create tevent request for setnetgrent\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not create tevent request for setnetgrent\n"); return NULL; } @@ -207,11 +212,11 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx, client->rctx->default_domain, rawname, &domname, &state->netgr_shortname); if (ret != EOK) { - DEBUG(2, "Invalid name received [%s]\n", rawname); + DEBUG(SSSDBG_OP_FAILURE, "Invalid name received [%s]\n", rawname); goto error; } - DEBUG(4, "Requesting info for netgroup [%s] from [%s]\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for netgroup [%s] from [%s]\n", state->netgr_shortname, domname?domname:"<ALL>"); if (domname) { @@ -341,7 +346,7 @@ static errno_t setnetgrent_retry(struct tevent_req *req) ret = set_netgroup_entry(nctx, state->netgr); if (ret != EOK) { - DEBUG(1, "set_netgroup_entry failed.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "set_netgroup_entry failed.\n"); talloc_free(state->netgr); goto done; } @@ -418,7 +423,8 @@ static void set_netgr_lifetime(uint32_t lifetime, setnetgrent_result_timeout, netgr); if (!te) { - DEBUG(0, "Could not set up life timer for setnetgrent result object. " + DEBUG(SSSDBG_FATAL_FAILURE, + "Could not set up life timer for setnetgrent result object. " "Entries may become stale.\n"); } } @@ -458,10 +464,11 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) return ENOMEM; } - DEBUG(4, "Requesting info for [%s@%s]\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for [%s@%s]\n", name, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } @@ -485,7 +492,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) } if (ret != EOK) { - DEBUG(1, "Failed to make request to our cache!\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to make request to our cache!\n"); return EIO; } @@ -493,7 +501,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &netgr); if (ret != EOK) { /* Something really bad happened! */ - DEBUG(0, "Netgroup entry was lost!\n"); + DEBUG(SSSDBG_FATAL_FAILURE, "Netgroup entry was lost!\n"); return ret; } @@ -502,7 +510,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &netgr->entries); if (ret == ENOENT) { /* This netgroup was not found in this domain */ - DEBUG(2, "No results for netgroup %s (domain %s)\n", + DEBUG(SSSDBG_OP_FAILURE, "No results for netgroup %s (domain %s)\n", name, dom->name); if (!step_ctx->dctx->check_provider) { @@ -516,7 +524,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) } if (ret != EOK) { - DEBUG(1, "Failed to convert results into entries\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to convert results into entries\n"); netgr->ready = true; netgr->found = false; set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); @@ -542,7 +551,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) } /* Results found */ - DEBUG(6, "Returning info for netgroup [%s@%s]\n", + DEBUG(SSSDBG_TRACE_FUNC, "Returning info for netgroup [%s@%s]\n", name, dom->name); netgr->ready = true; netgr->found = true; @@ -563,7 +572,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) netgr = talloc_zero(step_ctx->nctx, struct getent_ctx); if (netgr == NULL) { - DEBUG(1, "talloc_zero failed, ignored.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed, ignored.\n"); } else { netgr->ready = true; netgr->found = false; @@ -571,14 +580,14 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) netgr->lookup_table = step_ctx->nctx->netgroups; netgr->name = talloc_strdup(netgr, step_ctx->name); if (netgr->name == NULL) { - DEBUG(1, "talloc_strdup failed.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); talloc_free(netgr); return ENOMEM; } ret = set_netgroup_entry(step_ctx->nctx, netgr); if (ret != EOK) { - DEBUG(1, "set_netgroup_entry failed, ignored.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "set_netgroup_entry failed, ignored.\n"); } set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); } @@ -596,7 +605,8 @@ static void lookup_netgr_dp_callback(uint16_t err_maj, uint32_t err_min, int ret; if (err_maj) { - DEBUG(2, "Unable to get information from Data Provider\n" + DEBUG(SSSDBG_OP_FAILURE, + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, err_msg); @@ -658,7 +668,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) reqret = setnetgrent_recv(req); talloc_zfree(req); if (reqret != EOK && reqret != ENOENT) { - DEBUG(1, "setnetgrent failed\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "setnetgrent failed\n"); nss_cmd_done(cmdctx, reqret); return; } @@ -675,7 +685,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) packet = cmdctx->cctx->creq->out; ret = sss_packet_grow(packet, 2*sizeof(uint32_t)); if (ret != EOK) { - DEBUG(1, "Couldn't grow the packet\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Couldn't grow the packet\n"); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -692,7 +702,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) return; } - DEBUG(1, "Error creating packet\n"); + DEBUG(SSSDBG_CRIT_FAILURE, "Error creating packet\n"); } static void setnetgrent_implicit_done(struct tevent_req *req); @@ -706,7 +716,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) struct getent_ctx *netgr; struct tevent_req *req; - DEBUG(4, "Requesting netgroup data\n"); + DEBUG(SSSDBG_CONF_SETTINGS, "Requesting netgroup data\n"); cmdctx = talloc_zero(client, struct nss_cmd_ctx); if (!cmdctx) { @@ -739,7 +749,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) return EOK; } else if (ret != EOK) { - DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n", ret, strerror(ret)); return nss_cmd_done(cmdctx, ret); @@ -758,16 +768,18 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) return EOK; } else if (!netgr->found) { - DEBUG(6, "Results for [%s] not found.\n", client->netgr_name); + DEBUG(SSSDBG_TRACE_FUNC, + "Results for [%s] not found.\n", client->netgr_name); return ENOENT; } - DEBUG(6, "Returning results for [%s]\n", client->netgr_name); + DEBUG(SSSDBG_TRACE_FUNC, + "Returning results for [%s]\n", client->netgr_name); /* Read the result strings */ ret = nss_cmd_getnetgrent_process(cmdctx, netgr); if (ret != EOK) { - DEBUG(1, "Failed: [%d][%s]\n", ret, strerror(ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed: [%d][%s]\n", ret, strerror(ret)); } return ret; } @@ -789,7 +801,8 @@ static void setnetgrent_implicit_done(struct tevent_req *req) * nss_cmd_retnetgrent later */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, "Implicit setnetgrent failed with unexpected error " + DEBUG(SSSDBG_FATAL_FAILURE, + "Implicit setnetgrent failed with unexpected error " "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -804,11 +817,12 @@ static void setnetgrent_implicit_done(struct tevent_req *req) ret = get_netgroup_entry(nctx, cmdctx->cctx->netgr_name, &netgr); if (ret == ENOENT) { /* Critical error. This should never happen */ - DEBUG(0, "Implicit setnetgrent returned success without creating " + DEBUG(SSSDBG_FATAL_FAILURE, + "Implicit setnetgrent returned success without creating " "result object.\n"); NSS_CMD_FATAL_ERROR(cmdctx); } else if (ret != EOK) { - DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); @@ -816,14 +830,16 @@ static void setnetgrent_implicit_done(struct tevent_req *req) if (!netgr->ready) { /* Critical error. This should never happen */ - DEBUG(0, "Implicit setnetgrent returned success without creating " + DEBUG(SSSDBG_FATAL_FAILURE, + "Implicit setnetgrent returned success without creating " "result object.\n"); NSS_CMD_FATAL_ERROR(cmdctx); } ret = nss_cmd_getnetgrent_process(cmdctx, netgr); if (ret != EOK) { - DEBUG(0, "Immediate retrieval failed with unexpected error " + DEBUG(SSSDBG_FATAL_FAILURE, + "Immediate retrieval failed with unexpected error " "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -858,7 +874,7 @@ static errno_t nss_cmd_getnetgrent_process(struct nss_cmd_ctx *cmdctx, if (!netgr->entries || netgr->entries[0] == NULL) { /* No entries */ - DEBUG(5, "No entries found\n"); + DEBUG(SSSDBG_FUNC_DATA, "No entries found\n"); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return nss_cmd_done(cmdctx, ret); @@ -953,7 +969,8 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client, } else if (entries[client->netgrent_cur]->type == SYSDB_NETGROUP_GROUP_VAL) { if (entries[client->netgrent_cur]->value.groupname == NULL || entries[client->netgrent_cur]->value.groupname[0] == '\0') { - DEBUG(1, "Empty netgroup member. Please check your cache.\n"); + DEBUG(SSSDBG_CRIT_FAILURE, + "Empty netgroup member. Please check your cache.\n"); continue; } @@ -975,7 +992,8 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client, grouplen); rp += grouplen; } else { - DEBUG(1, "Unexpected value type for netgroup entry. " + DEBUG(SSSDBG_CRIT_FAILURE, + "Unexpected value type for netgroup entry. " "Please check your cache.\n"); continue; } diff --git a/src/responder/nss/nsssrv_private.h b/src/responder/nss/nsssrv_private.h index fbfe5ee94..2dcc07b5c 100644 --- a/src/responder/nss/nsssrv_private.h +++ b/src/responder/nss/nsssrv_private.h @@ -95,13 +95,13 @@ struct setent_step_ctx { }; #define NSS_CMD_FATAL_ERROR(cctx) do { \ - DEBUG(1,"Fatal error, killing connection!\n"); \ + DEBUG(SSSDBG_CRIT_FAILURE,"Fatal error, killing connection!\n"); \ talloc_free(cctx); \ return; \ } while(0) #define NSS_CMD_FATAL_ERROR_CODE(cctx, ret) do { \ - DEBUG(1,"Fatal error, killing connection!\n"); \ + DEBUG(SSSDBG_CRIT_FAILURE,"Fatal error, killing connection!\n"); \ talloc_free(cctx); \ return ret; \ } while(0) diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c index 7cfaf1e6b..67ca5d592 100644 --- a/src/responder/nss/nsssrv_services.c +++ b/src/responder/nss/nsssrv_services.c @@ -631,7 +631,7 @@ fill_service(struct sss_packet *packet, /* new service */ if (!ldb_msg_check_string_attribute(msg, "objectClass", SYSDB_SVC_CLASS)) { - DEBUG(1, "Wrong object (%s) found on stack!\n", + DEBUG(SSSDBG_CRIT_FAILURE, "Wrong object (%s) found on stack!\n", ldb_dn_get_linearized(msg->dn)); continue; } |