diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-11-26 10:04:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-11-26 10:04:40 +0000 |
commit | 08e88c5efc65a6f49da40aa002bc5f4b0ebee49d (patch) | |
tree | 21a3feb40eb54e5f5152cc8605f4c5e07e85052b /src/stls | |
parent | 9e6464c5f9d82158d81c027207594b5e12a94ca5 (diff) | |
download | s6-networking-08e88c5efc65a6f49da40aa002bc5f4b0ebee49d.tar.xz |
Add -z option to s6-tlsc/s6-tlsd to clean TLS env vars before spawning (default)
Diffstat (limited to 'src/stls')
-rw-r--r-- | src/stls/deps-lib/stls | 1 | ||||
-rw-r--r-- | src/stls/stls_s6tlsc.c | 3 | ||||
-rw-r--r-- | src/stls/stls_s6tlsd.c | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/stls/deps-lib/stls b/src/stls/deps-lib/stls index 799c7ae..f215998 100644 --- a/src/stls/deps-lib/stls +++ b/src/stls/deps-lib/stls @@ -2,4 +2,5 @@ stls_run.o stls_s6tlsc.o stls_s6tlsd.o -ltls +-ls6net -lskarnet diff --git a/src/stls/stls_s6tlsc.c b/src/stls/stls_s6tlsc.c index aa82087..194afb9 100644 --- a/src/stls/stls_s6tlsc.c +++ b/src/stls/stls_s6tlsc.c @@ -8,6 +8,7 @@ #include <skalibs/tai.h> #include <skalibs/env.h> #include <skalibs/djbunix.h> +#include <s6-networking/s6net-utils.h> #include <s6-networking/stls.h> #define diecfg(cfg, s) strerr_diefu3x(96, (s), ": ", tls_config_error(cfg)) @@ -73,7 +74,7 @@ int stls_s6tlsc (char const *const *argv, char const *const *envp, tain_t const if (tls_configure(ctx, cfg) < 0) diectx(97, ctx, "tls_configure") ; tls_config_free(cfg) ; - pid = child_spawn2(argv[0], argv, envp, fds) ; + pid = s6net_clean_tls_and_spawn(argv, envp, fds, !!(preoptions & 2)) ; if (!pid) strerr_diefu2sys(111, "spawn ", argv[0]) ; if (gid && setgid(gid) < 0) strerr_diefu1sys(111, "setgid") ; if (uid && setuid(uid) < 0) strerr_diefu1sys(111, "setuid") ; diff --git a/src/stls/stls_s6tlsd.c b/src/stls/stls_s6tlsd.c index 61b1343..ff1b308 100644 --- a/src/stls/stls_s6tlsd.c +++ b/src/stls/stls_s6tlsd.c @@ -8,6 +8,7 @@ #include <skalibs/tai.h> #include <skalibs/env.h> #include <skalibs/djbunix.h> +#include <s6-networking/s6net-utils.h> #include <s6-networking/stls.h> #define diecfg(cfg, s) strerr_diefu3x(96, (s), ": ", tls_config_error(cfg)) @@ -70,7 +71,7 @@ int stls_s6tlsd (char const *const *argv, char const *const *envp, tain_t const if (tls_configure(ctx, cfg) < 0) diectx(97, ctx, "tls_configure") ; tls_config_free(cfg) ; - pid = child_spawn2(argv[0], argv, envp, fds) ; + pid = s6net_clean_tls_and_spawn(argv, envp, fds, !!(preoptions & 2)) ; if (!pid) strerr_diefu2sys(111, "spawn ", argv[0]) ; if (gid && setgid(gid) < 0) strerr_diefu1sys(111, "setgid") ; if (uid && setuid(uid) < 0) strerr_diefu1sys(111, "setuid") ; |