X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=execute.c;h=bf576acf318abf683432cab68c877b7d3f4bf278;hb=8468b2b9d524832211f8e20791a1459003a563ff;hp=3ed645a554a20dcedc4564ecb3e537ca2b4ef1ea;hpb=802014dde0c3b25a48a4c6e5b09d20f52fb94324;p=fips diff --git a/execute.c b/execute.c index 3ed645a..bf576ac 100644 --- a/execute.c +++ b/execute.c @@ -19,12 +19,8 @@ * THE SOFTWARE. */ -#include "config.h" +#include "fips.h" -#include -#include - -#include #include #include @@ -301,10 +297,21 @@ fork_exec_with_fips_preload_and_wait (char * const argv[]) if (pid == 0) { void *ctx = talloc_new (NULL); char *lib_path; + char *ld_preload_value; lib_path = find_libfips_path (ctx, argv[0]); - setenv ("LD_PRELOAD", lib_path, 1); + ld_preload_value = getenv ("LD_PRELOAD"); + + if (ld_preload_value) { + ld_preload_value = talloc_asprintf(ctx, "%s:%s", + ld_preload_value, + lib_path); + } else { + ld_preload_value = lib_path; + } + + setenv ("LD_PRELOAD", ld_preload_value, 1); talloc_free (ctx);