summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-setuidgid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemontools-extras/s6-setuidgid.c')
-rw-r--r--src/daemontools-extras/s6-setuidgid.c13
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++ ;