diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-28 13:59:16 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-28 13:59:16 +0000 |
commit | 04b699857c141a93fc981b83ba02b452ce3a2ddc (patch) | |
tree | f22701124126003ef8f3bca685c94b0de0cd9dec /src/conn-tools | |
parent | a4deb6285e4a3d4aa10fe1913e0be400ec4be25e (diff) | |
download | s6-04b699857c141a93fc981b83ba02b452ce3a2ddc.tar.xz |
Switch to xpathexec_*
Diffstat (limited to 'src/conn-tools')
-rw-r--r-- | src/conn-tools/s6-connlimit.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcclient.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcserver-access.c | 7 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcserver-socketbinder.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcserver.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcserverd.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-sudo.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-sudod.c | 9 |
8 files changed, 12 insertions, 22 deletions
diff --git a/src/conn-tools/s6-connlimit.c b/src/conn-tools/s6-connlimit.c index d7d48c9..b34d411 100644 --- a/src/conn-tools/s6-connlimit.c +++ b/src/conn-tools/s6-connlimit.c @@ -33,7 +33,6 @@ int main (int argc, char const *const *argv, char const *const *envp) strerr_dief2x(1, "number of connections from this client limited to ", x) ; } } - pathexec0_run(argv+1, envp) ; (void)argc ; - strerr_dieexec(111, argv[1]) ; + xpathexec0_run(argv+1, envp) ; } diff --git a/src/conn-tools/s6-ipcclient.c b/src/conn-tools/s6-ipcclient.c index a8c6075..cbbb54d 100644 --- a/src/conn-tools/s6-ipcclient.c +++ b/src/conn-tools/s6-ipcclient.c @@ -61,7 +61,6 @@ int main (int argc, char const *const *argv, char const *const *envp) strerr_diefu2sys(111, "set up fd ", "6") ; if (fd_copy(7, 6) < 0) strerr_diefu2sys(111, "set up fd ", "7") ; - pathexec_r(argv+1, envp, env_len(envp), modif, i) ; + xpathexec_r(argv+1, envp, env_len(envp), modif, i) ; } - strerr_dieexec(111, argv[1]) ; } diff --git a/src/conn-tools/s6-ipcserver-access.c b/src/conn-tools/s6-ipcserver-access.c index b7f2ece..c423974 100644 --- a/src/conn-tools/s6-ipcserver-access.c +++ b/src/conn-tools/s6-ipcserver-access.c @@ -206,10 +206,7 @@ int main (int argc, char const *const *argv, char const *const *envp) if (params.exec.len) { char *specialargv[4] = { EXECLINE_EXTBINPREFIX "execlineb", "-c", params.exec.s, 0 } ; - pathexec_r((char const *const *)specialargv, envp, env_len(envp), params.env.s, params.env.len) ; - strerr_dieexec(111, specialargv[0]) ; + xpathexec_r((char const *const *)specialargv, envp, env_len(envp), params.env.s, params.env.len) ; } - - pathexec_r(argv, envp, env_len(envp), params.env.s, params.env.len) ; - strerr_dieexec(111, argv[0]) ; + else xpathexec_r(argv, envp, env_len(envp), params.env.s, params.env.len) ; } diff --git a/src/conn-tools/s6-ipcserver-socketbinder.c b/src/conn-tools/s6-ipcserver-socketbinder.c index 5d74096..8215fa2 100644 --- a/src/conn-tools/s6-ipcserver-socketbinder.c +++ b/src/conn-tools/s6-ipcserver-socketbinder.c @@ -48,6 +48,5 @@ int main (int argc, char const *const *argv, char const *const *envp) if (backlog && ipc_listen(0, backlog) < 0) strerr_diefu2sys(111, "listen to ", argv[0]) ; - pathexec_run(argv[1], argv + 1, envp) ; - strerr_dieexec(111, argv[1]) ; + xpathexec_run(argv[1], argv + 1, envp) ; } diff --git a/src/conn-tools/s6-ipcserver.c b/src/conn-tools/s6-ipcserver.c index 4f45c82..f259c15 100644 --- a/src/conn-tools/s6-ipcserver.c +++ b/src/conn-tools/s6-ipcserver.c @@ -122,7 +122,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/conn-tools/s6-ipcserverd.c b/src/conn-tools/s6-ipcserverd.c index abfaeed..8fac429 100644 --- a/src/conn-tools/s6-ipcserverd.c +++ b/src/conn-tools/s6-ipcserverd.c @@ -255,8 +255,7 @@ static void run_child (int s, uid_t uid, gid_t gid, unsigned int num, char const fmt[n++] = 0 ; memcpy(fmt+n, "IPCREMOTEPATH=", 14) ; n += 14 ; memcpy(fmt+n, remotepath, rplen) ; n += rplen ; - pathexec_r(argv, envp, env_len(envp), fmt, n) ; - strerr_dieexec(111, argv[0]) ; + xpathexec_r(argv, envp, env_len(envp), fmt, n) ; } static void new_connection (int s, char const *remotepath, char const *const *argv, char const *const *envp) diff --git a/src/conn-tools/s6-sudo.c b/src/conn-tools/s6-sudo.c index c422a1d..d4e3b03 100644 --- a/src/conn-tools/s6-sudo.c +++ b/src/conn-tools/s6-sudo.c @@ -61,7 +61,6 @@ int main (int argc, char const *const *argv, char const *const *envp) eargv[n++] = "--" ; while (argc--) eargv[n++] = *argv++ ; eargv[n++] = 0 ; - pathexec_run(eargv[0], eargv, envp) ; + xpathexec_run(eargv[0], eargv, envp) ; } - strerr_dieexec(111, S6_BINPREFIX "s6-ipcclient") ; } diff --git a/src/conn-tools/s6-sudod.c b/src/conn-tools/s6-sudod.c index a24e727..a7c5668 100644 --- a/src/conn-tools/s6-sudod.c +++ b/src/conn-tools/s6-sudod.c @@ -145,6 +145,7 @@ int main (int argc, char const *const *argv, char const *const *envp) if (pid < 0) strerr_diefu1sys(111, "fork") ; if (!pid) { + char c ; PROG = "s6-sudod (child)" ; fd_close(p[0]) ; if ((fd_move(2, m.fds[2]) < 0) @@ -157,11 +158,9 @@ int main (int argc, char const *const *argv, char const *const *envp) } selfpipe_finish() ; pathexec0_run(targv, tenvp) ; - { - char c = errno ; - fd_write(p[1], &c, 1) ; - } - strerr_dieexec(111, targv[0]) ; + c = errno ; + fd_write(p[1], &c, 1) ; + strerr_dieexec(c == ENOENT ? 127 : 126, targv[0]) ; } fd_close(p[1]) ; { |