summaryrefslogtreecommitdiff
path: root/src/responder/autofs
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-26 13:06:26 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-05-03 11:46:17 -0400
commit5f93f452e4a80d6b0243eaf3c583d0caf9981ca0 (patch)
tree73a0d654872cc5d8d4386894cdac491fdd3c8463 /src/responder/autofs
parent07002c911aa643000856f78707f1fee72b5eea29 (diff)
downloadsssd-5f93f452e4a80d6b0243eaf3c583d0caf9981ca0.tar.gz
sssd-5f93f452e4a80d6b0243eaf3c583d0caf9981ca0.tar.bz2
sssd-5f93f452e4a80d6b0243eaf3c583d0caf9981ca0.zip
AUTOFS: remove unused assignments
Also changes setautomntent_send so that is only return NULL in case the tevent_req creation fails.
Diffstat (limited to 'src/responder/autofs')
-rw-r--r--src/responder/autofs/autofssrv_cmd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c
index ebf68b84..7064591a 100644
--- a/src/responder/autofs/autofssrv_cmd.c
+++ b/src/responder/autofs/autofssrv_cmd.c
@@ -361,13 +361,14 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
if (!req) {
DEBUG(SSSDBG_FATAL_FAILURE,
("Could not create tevent request for setautomntent\n"));
- goto fail;
+ return NULL;
}
state->cmdctx = cmdctx;
dctx = talloc_zero(state, struct autofs_dom_ctx);
if (!dctx) {
DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory\n"));
+ ret = ENOMEM;
goto fail;
}
dctx->cmd_ctx = state->cmdctx;
@@ -388,11 +389,13 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
if (domname) {
dctx->domain = responder_get_domain(dctx, client->rctx, domname);
if (!dctx->domain) {
+ ret = EINVAL;
goto fail;
}
client->automntmap_name = talloc_strdup(client, rawname);
if (!client->automntmap_name) {
+ ret = ENOMEM;
goto fail;
}
} else {
@@ -402,6 +405,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
client->automntmap_name = talloc_strdup(client, state->mapname);
if (!client->automntmap_name) {
+ ret = ENOMEM;
goto fail;
}
}
@@ -504,6 +508,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
} else if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get data from cache\n"));
talloc_free(state->map);
+ ret = ENOMEM;
goto fail;
}
@@ -520,8 +525,9 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
return req;
fail:
- talloc_free(req);
- return NULL;
+ tevent_req_error(req, ret);
+ tevent_req_post(req, actx->rctx->ev);
+ return req;
}
static errno_t
@@ -585,7 +591,6 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx)
}
else break;
}
- ret = EOK;
}
ret = get_autofs_map(lookup_ctx->actx, lookup_ctx->mapname, &map);