diff options
-rw-r--r-- | src/responder/autofs/autofssrv_cmd.c | 13 | ||||
-rw-r--r-- | src/sss_client/autofs/sss_autofs.c | 1 |
2 files changed, 9 insertions, 5 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); diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c index 0125e6ee..e87ef4fd 100644 --- a/src/sss_client/autofs/sss_autofs.c +++ b/src/sss_client/autofs/sss_autofs.c @@ -281,7 +281,6 @@ _sss_getautomntent_r(char **key, char **value, void *context) } /* Don't try to handle any error codes, just go to the responder again */ - ret = 0; data_len = sizeof(uint32_t) + /* mapname len */ name_len + 1 + /* mapname\0 */ sizeof(uint32_t) + /* index into the map */ |