diff options
Diffstat (limited to 'src/responder/nss/nsssrv_netgroup.c')
-rw-r--r-- | src/responder/nss/nsssrv_netgroup.c | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index 18e857937..60c5f838b 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -50,8 +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", - hret, hash_error_string(hret))); + DEBUG(1, "Unexpected error reading from netgroup hash [%d][%s]\n", + hret, hash_error_string(hret)); return EIO; } @@ -64,7 +64,7 @@ static errno_t set_netgroup_entry(struct nss_ctx *nctx, int hret; if (netgr->name == NULL) { - DEBUG(1, ("Missing netgroup name.\n")); + DEBUG(1, "Missing netgroup name.\n"); return EINVAL; } /* Add this entry to the hash table */ @@ -74,8 +74,8 @@ 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(0, "Unable to add hash table entry for [%s]", key.str); + DEBUG(4, "Hash error [%d][%s]", hret, hash_error_string(hret)); return EIO; } talloc_steal(nctx->netgroups, netgr); @@ -125,7 +125,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(0, "Fatal error calling setnetgrent_send\n"); ret = EIO; goto done; } @@ -143,8 +143,8 @@ static int netgr_hash_remove (TALLOC_CTX *ctx) talloc_get_type(ctx, struct getent_ctx); if (netgr->lookup_table == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("netgroup [%s] was already removed\n", - netgr->name)); + DEBUG(SSSDBG_TRACE_LIBS, "netgroup [%s] was already removed\n", + netgr->name); return EOK; } @@ -154,8 +154,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", - netgr->name, hret, hash_error_string(hret))); + DEBUG(0, "Could not remove key [%s] from table! [%d][%s]\n", + netgr->name, hret, hash_error_string(hret)); return -1; } return 0; @@ -187,7 +187,7 @@ 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(0, "Could not create tevent request for setnetgrent\n"); return NULL; } @@ -207,12 +207,12 @@ 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(2, "Invalid name received [%s]\n", rawname); goto error; } - DEBUG(4, ("Requesting info for netgroup [%s] from [%s]\n", - state->netgr_shortname, domname?domname:"<ALL>")); + DEBUG(4, "Requesting info for netgroup [%s] from [%s]\n", + state->netgr_shortname, domname?domname:"<ALL>"); if (domname) { dctx->domain = responder_get_domain(client->rctx, domname); @@ -341,7 +341,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(1, "set_netgroup_entry failed.\n"); talloc_free(state->netgr); goto done; } @@ -418,8 +418,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. " - "Entries may become stale.\n")); + DEBUG(0, "Could not set up life timer for setnetgrent result object. " + "Entries may become stale.\n"); } } @@ -455,15 +455,15 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) name = sss_get_cased_name(step_ctx, step_ctx->name, dom->case_sensitive); if (!name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_get_cased_name failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_get_cased_name failed\n"); return ENOMEM; } - DEBUG(4, ("Requesting info for [%s@%s]\n", - name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", + name, dom->name); sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; } @@ -472,7 +472,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &step_ctx->dctx->res); if (step_ctx->dctx->res->count > 1) { DEBUG(SSSDBG_FATAL_FAILURE, - ("getnetgr call returned more than one result !?!\n")); + "getnetgr call returned more than one result !?!\n"); return EMSGSIZE; } if (ret == ENOENT) { @@ -488,7 +488,7 @@ 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(1, "Failed to make request to our cache!\n"); return EIO; } @@ -496,7 +496,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(0, "Netgroup entry was lost!\n"); return ret; } @@ -505,8 +505,8 @@ 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", - name, dom->name)); + DEBUG(2, "No results for netgroup %s (domain %s)\n", + name, dom->name); if (!step_ctx->dctx->check_provider) { if (step_ctx->check_next) { @@ -519,7 +519,7 @@ 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(1, "Failed to convert results into entries\n"); netgr->ready = true; netgr->found = false; set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); @@ -545,8 +545,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) } /* Results found */ - DEBUG(6, ("Returning info for netgroup [%s@%s]\n", - name, dom->name)); + DEBUG(6, "Returning info for netgroup [%s@%s]\n", + name, dom->name); netgr->ready = true; netgr->found = true; if (step_ctx->nctx->cache_refresh_percent) { @@ -562,11 +562,11 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) /* If we've gotten here, then no domain contained this netgroup */ DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", step_ctx->name)); + "No matching domain found for [%s], fail!\n", step_ctx->name); netgr = talloc_zero(step_ctx->nctx, struct getent_ctx); if (netgr == NULL) { - DEBUG(1, ("talloc_zero failed, ignored.\n")); + DEBUG(1, "talloc_zero failed, ignored.\n"); } else { netgr->ready = true; netgr->found = false; @@ -574,14 +574,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(1, "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(1, "set_netgroup_entry failed, ignored.\n"); } set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); } @@ -599,10 +599,10 @@ 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(2, "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)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); /* Loop to the next domain if possible */ if (cmdctx->check_next && get_next_domain(dctx->domain, false)) { dctx->domain = get_next_domain(dctx->domain, false); @@ -661,7 +661,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(1, "setnetgrent failed\n"); nss_cmd_done(cmdctx, reqret); return; } @@ -678,7 +678,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(1, "Couldn't grow the packet\n"); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -691,7 +691,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) return; } - DEBUG(1, ("Error creating packet\n")); + DEBUG(1, "Error creating packet\n"); } static void setnetgrent_implicit_done(struct tevent_req *req); @@ -705,7 +705,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) struct getent_ctx *netgr; struct tevent_req *req; - DEBUG(4, ("Requesting netgroup data\n")); + DEBUG(4, "Requesting netgroup data\n"); cmdctx = talloc_zero(client, struct nss_cmd_ctx); if (!cmdctx) { @@ -738,8 +738,8 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) return EOK; } else if (ret != EOK) { - DEBUG(1, ("An unexpected error occurred: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret)); return nss_cmd_done(cmdctx, ret); } @@ -757,16 +757,16 @@ 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(6, "Results for [%s] not found.\n", client->netgr_name); return ENOENT; } - DEBUG(6, ("Returning results for [%s]\n", client->netgr_name)); + DEBUG(6, "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(1, "Failed: [%d][%s]\n", ret, strerror(ret)); } return ret; } @@ -788,8 +788,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 " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Implicit setnetgrent failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } @@ -803,27 +803,27 @@ 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 " - "result object.\n")); + DEBUG(0, "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", - ret, strerror(ret))); + DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } if (!netgr->ready) { /* Critical error. This should never happen */ - DEBUG(0, ("Implicit setnetgrent returned success without creating " - "result object.\n")); + DEBUG(0, "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 " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Immediate retrieval failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } } @@ -857,7 +857,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(5, "No entries found\n"); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return nss_cmd_done(cmdctx, ret); @@ -952,7 +952,7 @@ 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(1, "Empty netgroup member. Please check your cache.\n"); continue; } @@ -974,8 +974,8 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client, grouplen); rp += grouplen; } else { - DEBUG(1, ("Unexpected value type for netgroup entry. " - "Please check your cache.\n")); + DEBUG(1, "Unexpected value type for netgroup entry. " + "Please check your cache.\n"); continue; } @@ -1023,7 +1023,7 @@ netgroup_hash_delete_cb(hash_entry_t *item, netgr = talloc_get_type(item->value.ptr, struct getent_ctx); if (!netgr) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid netgroup\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid netgroup\n"); return; } @@ -1048,13 +1048,13 @@ errno_t nss_orphan_netgroups(struct nss_ctx *nctx) return EIO; } - DEBUG(SSSDBG_TRACE_FUNC, ("Removing netgroups from memory cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removing netgroups from memory cache.\n"); for (i = 0; i < mcount; i++) { /* netgroup entry will be deleted by setnetgrent_result_timeout */ hret = hash_delete(nctx->netgroups, &netgroups[i]); if (hret != HASH_SUCCESS) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not delete key from hash\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not delete key from hash\n"); continue; } } |