summaryrefslogtreecommitdiff
path: root/src/stls/stls_s6tlsc.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-12-04 13:44:23 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-12-04 13:44:23 +0000
commit5d38ea056c82221a0ddc206cd57dd7c1852a3159 (patch)
tree9494c8025aa9e0ffc3402eba9fd93b4843fe07a6 /src/stls/stls_s6tlsc.c
parent05f12f4e141e94b3aee7ec79eb6fb47ffd56a119 (diff)
downloads6-networking-5d38ea056c82221a0ddc206cd57dd7c1852a3159.tar.xz
Remove s6-tls* dependency to libs6net. Improve gen-deps to make dynlinking easier.
Diffstat (limited to 'src/stls/stls_s6tlsc.c')
-rw-r--r--src/stls/stls_s6tlsc.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/stls/stls_s6tlsc.c b/src/stls/stls_s6tlsc.c
index bafc2b8..9c30b60 100644
--- a/src/stls/stls_s6tlsc.c
+++ b/src/stls/stls_s6tlsc.c
@@ -8,21 +8,12 @@
#include <skalibs/tai.h>
#include <skalibs/env.h>
#include <skalibs/djbunix.h>
-#include <s6-networking/s6net-utils.h>
#include <s6-networking/stls.h>
+#include "stls-internal.h"
#define diecfg(cfg, s) strerr_diefu3x(96, (s), ": ", tls_config_error(cfg))
#define diectx(e, ctx, s) strerr_diefu3x(e, (s), ": ", tls_error(ctx))
-#ifdef DEBUG
-# include <skalibs/buffer.h>
-# include <skalibs/strerr2.h>
-# include <skalibs/lolstdio.h>
-# define PLM(...) (bprintf(buffer_2, "%s: debug: ", PROG), bprintf(buffer_2, __VA_ARGS__), buffer_putflush(buffer_2, "\n", 1))
-#else
-# define PLM(...)
-#endif
-
int stls_s6tlsc (char const *const *argv, char const *const *envp, tain_t const *tto, uint32_t preoptions, uint32_t options, uid_t uid, gid_t gid, unsigned int verbosity, char const *servername, int *sfd)
{
int fds[4] = { sfd[0], sfd[1], sfd[0], sfd[1] } ;
@@ -83,7 +74,7 @@ int stls_s6tlsc (char const *const *argv, char const *const *envp, tain_t const
if (!ctx) strerr_diefu1sys(111, "tls_client") ;
if (tls_configure(ctx, cfg) < 0) diectx(97, ctx, "tls_configure") ;
- pid = s6net_clean_tls_and_spawn(argv, envp, fds, !!(preoptions & 2)) ;
+ pid = stls_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") ;