summaryrefslogtreecommitdiff
path: root/src/conn-tools/s6-tlsc.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-11-26 10:04:40 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-11-26 10:04:40 +0000
commit08e88c5efc65a6f49da40aa002bc5f4b0ebee49d (patch)
tree21a3feb40eb54e5f5152cc8605f4c5e07e85052b /src/conn-tools/s6-tlsc.c
parent9e6464c5f9d82158d81c027207594b5e12a94ca5 (diff)
downloads6-networking-08e88c5efc65a6f49da40aa002bc5f4b0ebee49d.tar.xz
Add -z option to s6-tlsc/s6-tlsd to clean TLS env vars before spawning (default)
Diffstat (limited to 'src/conn-tools/s6-tlsc.c')
-rw-r--r--src/conn-tools/s6-tlsc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/conn-tools/s6-tlsc.c b/src/conn-tools/s6-tlsc.c
index 4476690..0c26ab0 100644
--- a/src/conn-tools/s6-tlsc.c
+++ b/src/conn-tools/s6-tlsc.c
@@ -31,7 +31,7 @@
#endif
-#define USAGE "s6-tlsc [ -S | -s ] [ -Y | -y ] [ -v verbosity ] [ -K timeout ] [ -k servername ] [ -6 rfd ] [ -7 wfd ] prog..."
+#define USAGE "s6-tlsc [ -S | -s ] [ -Y | -y ] [ -v verbosity ] [ -K timeout ] [ -k servername ] [ -Z | -z ] [ -6 rfd ] [ -7 wfd ] prog..."
#define dieusage() strerr_dieusage(100, USAGE)
int main (int argc, char const *const *argv, char const *const *envp)
@@ -41,7 +41,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
unsigned int verbosity = 1 ;
uid_t uid = 0 ;
gid_t gid = 0 ;
- uint32_t preoptions = 0 ;
+ uint32_t preoptions = 2 ;
uint32_t options = 1 ;
int fds[2] = { 6, 7 } ;
@@ -51,7 +51,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
unsigned int t = 0 ;
for (;;)
{
- register int opt = subgetopt_r(argc, argv, "SsYyv:K:k:6:7:", &l) ;
+ register int opt = subgetopt_r(argc, argv, "SsYyv:K:k:Zz6:7:", &l) ;
if (opt == -1) break ;
switch (opt)
{
@@ -62,6 +62,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
case 'v' : if (!uint0_scan(l.arg, &verbosity)) dieusage() ; break ;
case 'K' : if (!uint0_scan(l.arg, &t)) dieusage() ; break ;
case 'k' : servername = l.arg ; break ;
+ case 'Z' : preoptions &= ~(uint32_t)2 ; break ;
+ case 'z' : preoptions |= 2 ; break ;
case '6' :
{
unsigned int fd ;