summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-04-18 12:43:47 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-05-02 19:33:56 +0200
commit4668b4765530cf37289235e483f301100cc1ae21 (patch)
treeeaad011be91af70cde2fc0c723a132a5f9229c2a /src/responder
parent4e748c28dec6fcb732ebe24829f1b750074d488e (diff)
downloadsssd-4668b4765530cf37289235e483f301100cc1ae21.tar.gz
sssd-4668b4765530cf37289235e483f301100cc1ae21.tar.bz2
sssd-4668b4765530cf37289235e483f301100cc1ae21.zip
Remove unused TALLOC_CTX from responder_get_domain()
Recent refactoring removed the need to copy the domain info data of sub-domains because the related objects will not be removed from memory anymore.
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/autofs/autofssrv_cmd.c2
-rw-r--r--src/responder/common/negcache.c4
-rw-r--r--src/responder/common/responder.h3
-rw-r--r--src/responder/common/responder_common.c3
-rw-r--r--src/responder/nss/nsssrv_cmd.c4
-rw-r--r--src/responder/nss/nsssrv_netgroup.c2
-rw-r--r--src/responder/nss/nsssrv_services.c2
-rw-r--r--src/responder/pac/pacsrv_cmd.c4
-rw-r--r--src/responder/pam/pamsrv_cmd.c4
-rw-r--r--src/responder/ssh/sshsrv_cmd.c6
-rw-r--r--src/responder/sudo/sudosrv_query.c2
11 files changed, 16 insertions, 20 deletions
diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c
index 491afbb1..e9168ea8 100644
--- a/src/responder/autofs/autofssrv_cmd.c
+++ b/src/responder/autofs/autofssrv_cmd.c
@@ -448,7 +448,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
state->mapname, domname?domname:"<ALL>"));
if (domname) {
- dctx->domain = responder_get_domain(dctx, client->rctx, domname);
+ dctx->domain = responder_get_domain(client->rctx, domname);
if (!dctx->domain) {
ret = EINVAL;
goto fail;
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c
index 57d1fc8b..2e1c0af2 100644
--- a/src/responder/common/negcache.c
+++ b/src/responder/common/negcache.c
@@ -652,7 +652,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
continue;
}
if (domainname) {
- dom = responder_get_domain(tmpctx, rctx, domainname);
+ dom = responder_get_domain(rctx, domainname);
if (!dom) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Invalid domain name [%s]\n", domainname));
@@ -750,7 +750,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
continue;
}
if (domainname) {
- dom = responder_get_domain(tmpctx, rctx, domainname);
+ dom = responder_get_domain(rctx, domainname);
if (!dom) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Invalid domain name [%s]\n", domainname));
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 110bd38d..e1b0b002 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -169,8 +169,7 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx,
int sss_dp_get_domain_conn(struct resp_ctx *rctx, const char *domain,
struct be_conn **_conn);
struct sss_domain_info *
-responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx,
- const char *domain);
+responder_get_domain(struct resp_ctx *rctx, const char *domain);
/* responder_cmd.c */
int sss_cmd_empty_packet(struct sss_packet *packet);
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 35142c19..32925919 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -897,8 +897,7 @@ int sss_dp_get_domain_conn(struct resp_ctx *rctx, const char *domain,
}
struct sss_domain_info *
-responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx,
- const char *name)
+responder_get_domain(struct resp_ctx *rctx, const char *name)
{
time_t now = time(NULL);
time_t time_diff = 0;
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 7402dc6d..903481ff 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -1023,7 +1023,7 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx)
cmdctx->name, domname?domname:"<ALL>"));
if (domname) {
- dctx->domain = responder_get_domain(dctx, cctx->rctx, domname);
+ dctx->domain = responder_get_domain(cctx->rctx, domname);
if (!dctx->domain) {
ret = ENOENT;
goto done;
@@ -1107,7 +1107,7 @@ static void nss_cmd_getbynam_done(struct tevent_req *req)
cmdctx->name, domname?domname:"<ALL>"));
if (domname) {
- dctx->domain = responder_get_domain(dctx, cctx->rctx, domname);
+ dctx->domain = responder_get_domain(cctx->rctx, domname);
if (dctx->domain == NULL) {
ret = ENOENT;
goto done;
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 36792365..4ec4161c 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -209,7 +209,7 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx,
state->netgr_shortname, domname?domname:"<ALL>"));
if (domname) {
- dctx->domain = responder_get_domain(dctx, client->rctx, domname);
+ dctx->domain = responder_get_domain(client->rctx, domname);
if (!dctx->domain) {
ret = EINVAL;
goto error;
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index c9907423..99fc67e7 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -842,7 +842,7 @@ int nss_cmd_getservbyname(struct cli_ctx *cctx)
domname ? domname : "<ALL>"));
if (domname) {
- dctx->domain = responder_get_domain(dctx, cctx->rctx, domname);
+ dctx->domain = responder_get_domain(cctx->rctx, domname);
if (!dctx->domain) {
ret = ENOENT;
goto done;
diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c
index ac49a0e7..2b6cd965 100644
--- a/src/responder/pac/pacsrv_cmd.c
+++ b/src/responder/pac/pacsrv_cmd.c
@@ -143,7 +143,7 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx)
goto done;
}
- pr_ctx->dom = responder_get_domain(pr_ctx, cctx->rctx, pr_ctx->domain_name);
+ pr_ctx->dom = responder_get_domain(cctx->rctx, pr_ctx->domain_name);
if (pr_ctx->dom == NULL) {
req = sss_dp_get_domains_send(cctx->rctx, cctx->rctx, true,
pr_ctx->domain_name);
@@ -178,7 +178,7 @@ static void pac_get_domains_done(struct tevent_req *req)
goto done;
}
- pr_ctx->dom = responder_get_domain(pr_ctx, cctx->rctx, pr_ctx->domain_name);
+ pr_ctx->dom = responder_get_domain(cctx->rctx, pr_ctx->domain_name);
if (pr_ctx->dom == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("Corresponding domain [%s] has not been "
"found\n", pr_ctx->domain_name));
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index ba4e969f..8350f655 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -795,7 +795,7 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
/* now check user is valid */
if (pd->domain) {
- preq->domain = responder_get_domain(preq, cctx->rctx, pd->domain);
+ preq->domain = responder_get_domain(cctx->rctx, pd->domain);
if (!preq->domain) {
ret = ENOENT;
goto done;
@@ -867,7 +867,7 @@ static void pam_forwarder_cb(struct tevent_req *req)
}
if (preq->pd->domain) {
- preq->domain = responder_get_domain(preq, cctx->rctx, preq->pd->domain);
+ preq->domain = responder_get_domain(cctx->rctx, preq->pd->domain);
if (preq->domain == NULL) {
ret = ENOENT;
goto done;
diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c
index e0ce3c9b..671160ea 100644
--- a/src/responder/ssh/sshsrv_cmd.c
+++ b/src/responder/ssh/sshsrv_cmd.c
@@ -71,8 +71,7 @@ sss_ssh_cmd_get_user_pubkeys(struct cli_ctx *cctx)
}
if (cmd_ctx->domname) {
- cmd_ctx->domain = responder_get_domain(cmd_ctx, cctx->rctx,
- cmd_ctx->domname);
+ cmd_ctx->domain = responder_get_domain(cctx->rctx, cmd_ctx->domname);
if (!cmd_ctx->domain) {
ret = ENOENT;
goto done;
@@ -114,8 +113,7 @@ sss_ssh_cmd_get_host_pubkeys(struct cli_ctx *cctx)
cmd_ctx->domname ? cmd_ctx->domname : "<ALL>"));
if (cmd_ctx->domname) {
- cmd_ctx->domain = responder_get_domain(cmd_ctx, cctx->rctx,
- cmd_ctx->domname);
+ cmd_ctx->domain = responder_get_domain(cctx->rctx, cmd_ctx->domname);
if (!cmd_ctx->domain) {
ret = ENOENT;
goto done;
diff --git a/src/responder/sudo/sudosrv_query.c b/src/responder/sudo/sudosrv_query.c
index a8501df5..d88d2472 100644
--- a/src/responder/sudo/sudosrv_query.c
+++ b/src/responder/sudo/sudosrv_query.c
@@ -412,7 +412,7 @@ errno_t sudosrv_parse_query_recv(TALLOC_CTX *mem_ctx,
if (domainname != NULL) {
/* mem_ctx because it duplicates only subdomains not domains
* so I cannot easily steal it */
- domain = responder_get_domain(mem_ctx, state->rctx, domainname);
+ domain = responder_get_domain(state->rctx, domainname);
if (domain == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("Corresponding domain [%s] has not been "
"found\n", domainname));