From 6468d9f2bb30147967a724075c504afb3481d465 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 1 Dec 2014 12:25:24 +0100 Subject: Add extra_args to exec_child() Related: https://fedorahosted.org/sssd/ticket/2503 Currently all child processes use the same arguments, the construction of argv[] is even hardcoded in exec_child(). Add an extra_args[] array that extends the common set of argvs so that we can have child-specific arguments. Also adds a unit test. Reviewed-by: Sumit Bose --- src/providers/ad/ad_gpo.c | 2 +- src/providers/ipa/ipa_selinux.c | 3 ++- src/providers/krb5/krb5_child_handler.c | 3 ++- src/providers/ldap/sdap_child_helpers.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/providers') diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c index 83edbe4fb..62715861c 100644 --- a/src/providers/ad/ad_gpo.c +++ b/src/providers/ad/ad_gpo.c @@ -3960,7 +3960,7 @@ gpo_fork_child(struct tevent_req *req) if (pid == 0) { /* child */ err = exec_child(state, pipefd_to_child, pipefd_from_child, - GPO_CHILD, gpo_child_debug_fd); + GPO_CHILD, gpo_child_debug_fd, NULL); DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec gpo_child: [%d][%s].\n", err, strerror(err)); return err; diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c index 30ad6f0a7..531258dac 100644 --- a/src/providers/ipa/ipa_selinux.c +++ b/src/providers/ipa/ipa_selinux.c @@ -1036,7 +1036,8 @@ static errno_t selinux_fork_child(struct selinux_child_state *state) if (pid == 0) { /* child */ ret = exec_child(state, pipefd_to_child, pipefd_from_child, - SELINUX_CHILD, selinux_child_debug_fd); + SELINUX_CHILD, selinux_child_debug_fd, + NULL); DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec selinux_child: [%d][%s].\n", ret, sss_strerror(ret)); return ret; diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c index 93961172c..9bb61f654 100644 --- a/src/providers/krb5/krb5_child_handler.c +++ b/src/providers/krb5/krb5_child_handler.c @@ -299,7 +299,8 @@ static errno_t fork_child(struct tevent_req *req) if (pid == 0) { /* child */ err = exec_child(state, pipefd_to_child, pipefd_from_child, - KRB5_CHILD, state->kr->krb5_ctx->child_debug_fd); + KRB5_CHILD, state->kr->krb5_ctx->child_debug_fd, + NULL); if (err != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec KRB5 child: [%d][%s].\n", err, strerror(err)); diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c index 400109890..b60891d2b 100644 --- a/src/providers/ldap/sdap_child_helpers.c +++ b/src/providers/ldap/sdap_child_helpers.c @@ -108,7 +108,8 @@ static errno_t sdap_fork_child(struct tevent_context *ev, if (pid == 0) { /* child */ err = exec_child(child, pipefd_to_child, pipefd_from_child, - LDAP_CHILD, ldap_child_debug_fd); + LDAP_CHILD, ldap_child_debug_fd, + NULL); DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec LDAP child: [%d][%s].\n", err, strerror(err)); return err; -- cgit