diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/conn-tools/s6-ipcserver-access.c | 4 | ||||
-rw-r--r-- | src/conn-tools/s6-ipcserver.c | 13 | ||||
-rw-r--r-- | src/daemontools-extras/s6-log.c | 2 | ||||
-rw-r--r-- | src/daemontools-extras/s6-softlimit.c | 4 |
4 files changed, 12 insertions, 11 deletions
diff --git a/src/conn-tools/s6-ipcserver-access.c b/src/conn-tools/s6-ipcserver-access.c index c5e20c2..1444a38 100644 --- a/src/conn-tools/s6-ipcserver-access.c +++ b/src/conn-tools/s6-ipcserver-access.c @@ -150,8 +150,8 @@ int main (int argc, char const *const *argv, char const *const *envp) { char const *x ; char tmp[protolen + 11] ; - byte_copy(tmp, protolen, proto) ; - byte_copy(tmp + protolen, 11, "REMOTEEUID") ; + memcpy(tmp, proto, protolen) ; + memcpy(tmp + protolen, "REMOTEEUID", 11) ; x = env_get2(envp, tmp) ; if (!x) strerr_dienotset(100, tmp) ; if (!uid0_scan(x, &uid)) strerr_dieinvalid(100, tmp) ; diff --git a/src/conn-tools/s6-ipcserver.c b/src/conn-tools/s6-ipcserver.c index 9e85699..4f45c82 100644 --- a/src/conn-tools/s6-ipcserver.c +++ b/src/conn-tools/s6-ipcserver.c @@ -18,7 +18,8 @@ int main (int argc, char const *const *argv, char const *const *envp) int flagU = 0 ; int flaglookup = 1 ; int flagreuse = 1 ; - unsigned int uid = 0, gid = 0 ; + uid_t uid = 0 ; + gid_t gid = 0 ; gid_t gids[NGROUPS_MAX] ; size_t gidn = (size_t)-1 ; unsigned int maxconn = 0 ; @@ -43,8 +44,8 @@ int main (int argc, char const *const *argv, char const *const *envp) case 'c' : if (!uint0_scan(l.arg, &maxconn)) dieusage() ; if (!maxconn) maxconn = 1 ; break ; case 'C' : if (!uint0_scan(l.arg, &localmaxconn)) dieusage() ; if (!localmaxconn) localmaxconn = 1 ; break ; case 'b' : if (!uint0_scan(l.arg, &backlog)) dieusage() ; break ; - case 'u' : if (!uint0_scan(l.arg, &uid)) dieusage() ; break ; - case 'g' : if (!uint0_scan(l.arg, &gid)) dieusage() ; break ; + case 'u' : if (!uid0_scan(l.arg, &uid)) dieusage() ; break ; + case 'g' : if (!gid0_scan(l.arg, &gid)) dieusage() ; break ; case 'G' : if (!gid_scanlist(gids, NGROUPS_MAX, l.arg, &gidn) && *l.arg) dieusage() ; break ; case '1' : flag1 = 1 ; break ; case 'U' : flagU = 1 ; uid = 0 ; gid = 0 ; gidn = (size_t)-1 ; break ; @@ -58,7 +59,7 @@ int main (int argc, char const *const *argv, char const *const *envp) { size_t pos = 0 ; unsigned int m = 0 ; - char fmt[UINT_FMT * 5 + GID_FMT * NGROUPS_MAX] ; + char fmt[UINT_FMT * 3 + UID_FMT + GID_FMT * (NGROUPS_MAX+1)] ; char const *newargv[24 + argc] ; newargv[m++] = S6_BINPREFIX "s6-ipcserver-socketbinder" ; if (!flagreuse) newargv[m++] = "-D" ; @@ -80,14 +81,14 @@ int main (int argc, char const *const *argv, char const *const *envp) { newargv[m++] = "-u" ; newargv[m++] = fmt + pos ; - pos += uint_fmt(fmt + pos, uid) ; + pos += uid_fmt(fmt + pos, uid) ; fmt[pos++] = 0 ; } if (gid) { newargv[m++] = "-g" ; newargv[m++] = fmt + pos ; - pos += uint_fmt(fmt + pos, gid) ; + pos += gid_fmt(fmt + pos, gid) ; fmt[pos++] = 0 ; } if (gidn != (size_t)-1) diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c index bdc0a82..c57e6d7 100644 --- a/src/daemontools-extras/s6-log.c +++ b/src/daemontools-extras/s6-log.c @@ -567,7 +567,7 @@ static inline void logdir_init (unsigned int index, uint32_t s, uint32_t n, uint { logdir_t *ldp = logdirs + index ; struct stat st ; - size_t dirlen = str_len(name) ; + size_t dirlen = strlen(name) ; int r ; char x[dirlen + 11] ; ldp->s = s ; diff --git a/src/daemontools-extras/s6-softlimit.c b/src/daemontools-extras/s6-softlimit.c index 7de9f3d..d3fbaee 100644 --- a/src/daemontools-extras/s6-softlimit.c +++ b/src/daemontools-extras/s6-softlimit.c @@ -16,9 +16,9 @@ static void doit (int res, char const *arg) if ((arg[0] == '=') && !arg[1]) r.rlim_cur = r.rlim_max ; else { - uint64 n ; + uint64_t n ; if (!uint640_scan(arg, &n)) strerr_dieusage(100, USAGE) ; - if (n > (uint64)r.rlim_max) n = (uint64)r.rlim_max ; + if (n > (uint64_t)r.rlim_max) n = (uint64_t)r.rlim_max ; r.rlim_cur = (rlim_t)n ; } if (setrlimit(res, &r) < 0) strerr_diefu1sys(111, "setrlimit") ; |