diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ad/ad_gpo.c | 7 | ||||
-rw-r--r-- | src/providers/ad/ad_gpo.h | 4 | ||||
-rw-r--r-- | src/providers/ad/ad_gpo_child.c | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c index 1ae62e7c4..083fc8c2c 100644 --- a/src/providers/ad/ad_gpo.c +++ b/src/providers/ad/ad_gpo.c @@ -3961,9 +3961,10 @@ gpo_fork_child(struct tevent_req *req) pid = fork(); if (pid == 0) { /* child */ - err = exec_child(state, - pipefd_to_child, pipefd_from_child, - GPO_CHILD, gpo_child_debug_fd); + err = exec_child_ex(state, + pipefd_to_child, pipefd_from_child, + GPO_CHILD, gpo_child_debug_fd, NULL, + STDIN_FILENO, AD_GPO_CHILD_OUT_FILENO); DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec gpo_child: [%d][%s].\n", err, strerror(err)); return err; diff --git a/src/providers/ad/ad_gpo.h b/src/providers/ad/ad_gpo.h index 77051aada..9fd590a2b 100644 --- a/src/providers/ad/ad_gpo.h +++ b/src/providers/ad/ad_gpo.h @@ -23,6 +23,10 @@ #ifndef AD_GPO_H_ #define AD_GPO_H_ +#include "providers/ad/ad_access.h" + +#define AD_GPO_CHILD_OUT_FILENO 3 + /* * This pair of functions provides client-side GPO processing. * diff --git a/src/providers/ad/ad_gpo_child.c b/src/providers/ad/ad_gpo_child.c index aa0ab0dc3..1254b69cd 100644 --- a/src/providers/ad/ad_gpo_child.c +++ b/src/providers/ad/ad_gpo_child.c @@ -33,6 +33,7 @@ #include "util/util.h" #include "util/child_common.h" #include "providers/dp_backend.h" +#include "providers/ad/ad_gpo.h" #include "sss_cli.h" #define SMB_BUFFER_SIZE 65536 @@ -778,7 +779,7 @@ main(int argc, const char *argv[]) errno = 0; - written = sss_atomic_write_s(STDOUT_FILENO, resp->buf, resp->size); + written = sss_atomic_write_s(AD_GPO_CHILD_OUT_FILENO, resp->buf, resp->size); if (written == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", ret, @@ -793,13 +794,13 @@ main(int argc, const char *argv[]) } DEBUG(SSSDBG_TRACE_FUNC, "gpo_child completed successfully\n"); - close(STDOUT_FILENO); + close(AD_GPO_CHILD_OUT_FILENO); talloc_free(main_ctx); return EXIT_SUCCESS; fail: DEBUG(SSSDBG_CRIT_FAILURE, "gpo_child failed!\n"); - close(STDOUT_FILENO); + close(AD_GPO_CHILD_OUT_FILENO); talloc_free(main_ctx); return EXIT_FAILURE; } |