diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
commit | c60ebd422171808ad58b936914055397bb205bef (patch) | |
tree | 7db3e5728d72ad209f8e22b9eb9f337e0b0c3e58 /src/daemontools-extras/s6-setuidgid.c | |
parent | e28fe5908a91d8795ca9923d64eeed7d3e898434 (diff) | |
download | s6-c60ebd422171808ad58b936914055397bb205bef.tar.xz |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/daemontools-extras/s6-setuidgid.c')
-rw-r--r-- | src/daemontools-extras/s6-setuidgid.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/daemontools-extras/s6-setuidgid.c b/src/daemontools-extras/s6-setuidgid.c index 727696a..1893883 100644 --- a/src/daemontools-extras/s6-setuidgid.c +++ b/src/daemontools-extras/s6-setuidgid.c @@ -1,7 +1,6 @@ /* ISC license. */ -#include <sys/types.h> -#include <skalibs/bytestr.h> +#include <string.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> #include <s6/config.h> @@ -12,20 +11,20 @@ int main (int argc, char *const *argv, char const *const *envp) { char const *newargv[argc + 7] ; - size_t pos ; + char *colon ; unsigned int m = 0 ; PROG = "s6-setuidgid" ; if (argc < 3) dieusage() ; argv++ ; - pos = str_chr(argv[0], ':') ; - if (argv[0][pos]) + colon = strchr(argv[0], ':') ; + if (colon) { - argv[0][pos] = 0 ; + *colon = 0 ; newargv[m++] = S6_BINPREFIX "s6-applyuidgid" ; newargv[m++] = "-u" ; newargv[m++] = argv[0] ; newargv[m++] = "-g" ; - newargv[m++] = argv[0] + pos + 1 ; + newargv[m++] = colon + 1 ; newargv[m++] = "-G" ; newargv[m++] = "" ; argv++ ; |