diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-26 09:47:02 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-26 09:47:02 +0000 |
commit | 26cd94b2a8f6da396058b6c5d6446e237ec9d78f (patch) | |
tree | 13706df3bc9657d911a26133625044ae1e1acb30 /src/tls | |
parent | 51a612c34446e10a086947c410aa206fa978d169 (diff) | |
download | s6-networking-26cd94b2a8f6da396058b6c5d6446e237ec9d78f.tar.xz |
Convert to new exec.h syntax
Diffstat (limited to 'src/tls')
-rw-r--r-- | src/tls/s6-tlsclient.c | 12 | ||||
-rw-r--r-- | src/tls/s6-tlsserver.c | 7 | ||||
-rw-r--r-- | src/tls/s6tls_exec_tlscio.c | 5 | ||||
-rw-r--r-- | src/tls/s6tls_exec_tlsdio.c | 5 | ||||
-rw-r--r-- | src/tls/s6tls_sync_and_exec_app.c | 6 | ||||
-rw-r--r-- | src/tls/s6tls_ucspi_exec_app.c | 6 |
6 files changed, 21 insertions, 20 deletions
diff --git a/src/tls/s6-tlsclient.c b/src/tls/s6-tlsclient.c index 267f457..06ef4da 100644 --- a/src/tls/s6-tlsclient.c +++ b/src/tls/s6-tlsclient.c @@ -1,12 +1,14 @@ /* ISC license. */ -#include <string.h> #include <stdint.h> +#include <string.h> + #include <skalibs/types.h> #include <skalibs/sgetopt.h> #include <skalibs/strerr2.h> -#include <skalibs/djbunix.h> #include <skalibs/ip46.h> +#include <skalibs/exec.h> + #include <s6-networking/config.h> #define USAGE "s6-tlsclient [ options ] host port prog...\n" \ @@ -24,8 +26,8 @@ struct options_s unsigned int ximeout ; unsigned int yimeout ; unsigned int kimeout ; - uint16_t localport ; ip46full_t localip ; + uint16_t localport ; unsigned int verbosity : 2 ; unsigned int flag4 : 1 ; unsigned int flag6 : 1 ; @@ -62,7 +64,7 @@ struct options_s .doxy = 0 \ } -int main (int argc, char const *const *argv, char const *const *envp) +int main (int argc, char const *const *argv) { options_t o = OPTIONS_ZERO ; PROG = "s6-tlsclient" ; @@ -197,6 +199,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - xpathexec_run(newargv[0], newargv, envp) ; + xexec(newargv) ; } } diff --git a/src/tls/s6-tlsserver.c b/src/tls/s6-tlsserver.c index fb899eb..fe493ad 100644 --- a/src/tls/s6-tlsserver.c +++ b/src/tls/s6-tlsserver.c @@ -2,11 +2,14 @@ #include <sys/types.h> #include <limits.h> + #include <skalibs/types.h> #include <skalibs/sgetopt.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> + #include <s6/config.h> + #include <s6-networking/config.h> #define USAGE "s6-tlsserver [ -e ] [ options ] ip port prog...\n" \ @@ -80,7 +83,7 @@ struct options_s .doapply = 0 \ } -int main (int argc, char const *const *argv, char const *const *envp) +int main (int argc, char const *const *argv) { options_t o = OPTIONS_ZERO ; PROG = "s6-tlsserver" ; @@ -250,6 +253,6 @@ int main (int argc, char const *const *argv, char const *const *envp) } while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - xpathexec_run(newargv[0], newargv, envp) ; + xexec(newargv) ; } } diff --git a/src/tls/s6tls_exec_tlscio.c b/src/tls/s6tls_exec_tlscio.c index ad00ecd..e4e84f9 100644 --- a/src/tls/s6tls_exec_tlscio.c +++ b/src/tls/s6tls_exec_tlscio.c @@ -1,8 +1,7 @@ /* ISC license. */ -#include <skalibs/posixplz.h> #include <skalibs/types.h> -#include <skalibs/djbunix.h> +#include <skalibs/exec.h> #include <s6-networking/config.h> #include "s6tls-internal.h" @@ -49,5 +48,5 @@ void s6tls_exec_tlscio (int const *fds, uint32_t options, unsigned int verbosity newargv[m++] = fmtw ; fmtw[uint_fmt(fmtw, fds[1])] = 0 ; newargv[m++] = 0 ; - xpathexec_run(newargv[0], newargv, (char const *const *)environ) ; + xexec(newargv) ; } diff --git a/src/tls/s6tls_exec_tlsdio.c b/src/tls/s6tls_exec_tlsdio.c index b00adb2..3007cf0 100644 --- a/src/tls/s6tls_exec_tlsdio.c +++ b/src/tls/s6tls_exec_tlsdio.c @@ -1,8 +1,7 @@ /* ISC license. */ -#include <skalibs/posixplz.h> #include <skalibs/types.h> -#include <skalibs/djbunix.h> +#include <skalibs/exec.h> #include <s6-networking/config.h> #include "s6tls-internal.h" @@ -45,5 +44,5 @@ void s6tls_exec_tlsdio (int const *fds, uint32_t options, unsigned int verbosity newargv[m++] = fmtw ; fmtw[uint_fmt(fmtw, fds[1])] = 0 ; newargv[m++] = 0 ; - xpathexec_run(newargv[0], newargv, (char const *const *)environ) ; + xexec(newargv) ; } diff --git a/src/tls/s6tls_sync_and_exec_app.c b/src/tls/s6tls_sync_and_exec_app.c index 4ae63fa..ff42d73 100644 --- a/src/tls/s6tls_sync_and_exec_app.c +++ b/src/tls/s6tls_sync_and_exec_app.c @@ -1,12 +1,12 @@ /* ISC license. */ #include <stdint.h> +#include <string.h> #include <unistd.h> -#include <skalibs/posixplz.h> #include <skalibs/strerr2.h> -#include <skalibs/env.h> #include <skalibs/djbunix.h> +#include <skalibs/exec.h> #include "s6tls-internal.h" @@ -39,5 +39,5 @@ void s6tls_sync_and_exec_app (char const *const *argv, int const p[4][2], pid_t if (r >= MAXENVSIZE) strerr_dief1x(100, "SSL data too large") ; m += r - 1 ; - xpathexec_r(argv, (char const *const *)environ, env_len((char const *const *)environ), buf, m) ; + xmexec_m(argv, buf, m) ; } diff --git a/src/tls/s6tls_ucspi_exec_app.c b/src/tls/s6tls_ucspi_exec_app.c index f4b52ef..34c05e2 100644 --- a/src/tls/s6tls_ucspi_exec_app.c +++ b/src/tls/s6tls_ucspi_exec_app.c @@ -4,10 +4,8 @@ #include <string.h> #include <unistd.h> -#include <skalibs/posixplz.h> #include <skalibs/types.h> -#include <skalibs/env.h> -#include <skalibs/djbunix.h> +#include <skalibs/exec.h> #include "s6tls-internal.h" @@ -32,5 +30,5 @@ void s6tls_ucspi_exec_app (char const *const *argv, int const p[4][2], uint32_t memcpy(modif + m, "SSLWRITEFD=", 11) ; m += 11 ; m += uint_fmt(modif + m, p[0][1]) ; modif[m++] = 0 ; - xpathexec_r(argv, (char const *const *)environ, env_len((char const* const *)environ), modif, m) ; + xmexec_m(argv, modif, m) ; } |