From: Arran Cudbard-Bell Date: Tue, 18 Apr 2023 22:48:33 +0000 (+1000) Subject: detail: Emit an error message if we can't make changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ec16fb8b4db193d91ea05b0848beacdd4c32861;p=thirdparty%2Ffreeradius-server.git detail: Emit an error message if we can't make changes --- diff --git a/src/modules/rlm_detail/rlm_detail.c b/src/modules/rlm_detail/rlm_detail.c index 5337b3ce3c2..0757e30e4f2 100644 --- a/src/modules/rlm_detail/rlm_detail.c +++ b/src/modules/rlm_detail/rlm_detail.c @@ -382,7 +382,7 @@ static unlang_action_t CC_HINT(nonnull) detail_do(rlm_rcode_t *p_result, module_ int outfd, dupfd; char buffer[DIRLEN]; - FILE *outfp; + FILE *outfp = NULL; rlm_detail_t const *inst = talloc_get_type_abort_const(mctx->inst->data, rlm_detail_t); @@ -405,13 +405,11 @@ static unlang_action_t CC_HINT(nonnull) detail_do(rlm_rcode_t *p_result, module_ if (inst->group_is_set) { if (chown(buffer, -1, inst->group) == -1) { - RDEBUG2("Unable to set detail file group to '%s': %s", buffer, fr_syserror(errno)); - exfile_close(inst->ef, outfd); - RETURN_MODULE_FAIL; + RERROR("Unable to set detail file group to '%s': %s", buffer, fr_syserror(errno)); + goto fail; } } - outfp = NULL; dupfd = dup(outfd); if (dupfd < 0) { RERROR("Failed to dup() file descriptor for detail file");