From 1860f6407f834b681c21f67db7236eaad161524c Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 11 Oct 2024 16:17:53 +0900 Subject: spawn: Add new function to modify environment. * src/gpg-error.def.in (gpgrt_spawn_actions_set_envchange): New. * src/gpg-error.vers (gpgrt_spawn_actions_set_envchange): New. * src/gpg-error.h.in (gpgrt_spawn_actions_set_envchange): New. * src/gpgrt-int.h (_gpgrt_spawn_actions_set_envchange): New. * src/spawn-posix.c (struct gpgrt_spawn_actions): New field ENVCHANGE. (prepare_environ): New. (my_exec): Take care of ENVCHANGE. (_gpgrt_spawn_actions_set_envchange): New. * src/spawn-w32.c (struct gpgrt_spawn_actions): New field ENVCHANGE. (prepare_env_block): New. (_gpgrt_spawn_actions_set_envchange): New. (spawn_detached, _gpgrt_process_spawn): Take care of ENVCHANGE. * src/visibility.c (gpgrt_spawn_actions_set_envchange): New. * src/visibility.h (gpgrt_spawn_actions_set_envchange): New. * tests/Makefile.am (TESTS): Add t-spawn. * tests/t-spawn.c: New. -- GnuPG-bug-id: 7307 Signed-off-by: NIIBE Yutaka --- src/visibility.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/visibility.h') diff --git a/src/visibility.h b/src/visibility.h index 29ebaee..748a42a 100644 --- a/src/visibility.h +++ b/src/visibility.h @@ -231,6 +231,7 @@ MARK_VISIBLE (gpgrt_absfnameconcat) MARK_VISIBLE (gpgrt_spawn_actions_new) MARK_VISIBLE (gpgrt_spawn_actions_release) +MARK_VISIBLE (gpgrt_spawn_actions_set_envchange) #ifdef HAVE_W32_SYSTEM MARK_VISIBLE (gpgrt_spawn_actions_set_envvars) MARK_VISIBLE (gpgrt_spawn_actions_set_redirect) @@ -423,6 +424,7 @@ MARK_VISIBLE (gpgrt_spawn_actions_set_atfork) #define gpgrt_spawn_actions_new _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_spawn_actions_release _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_spawn_actions_set_envchange _gpgrt_USE_UNDERSCORED_FUNCTION #ifdef HAVE_W32_SYSTEM #define gpgrt_spawn_actions_set_envvars _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_spawn_actions_set_redirect _gpgrt_USE_UNDERSCORED_FUNCTION -- cgit v1.2.3