aboutsummaryrefslogtreecommitdiff
path: root/src/rc/supervise-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/supervise-daemon.c')
-rw-r--r--src/rc/supervise-daemon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index b3d63589..ea9e5333 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -855,10 +855,11 @@ int main(int argc, char **argv)
case 'u': /* --user <username>|<uid> */
{
+ char dummy[2];
p = optarg;
tmp = strsep(&p, ":");
changeuser = xstrdup(tmp);
- if (sscanf(tmp, "%d", &tid) != 1)
+ if (sscanf(tmp, "%d%1s", &tid, dummy) != 1)
pw = getpwnam(tmp);
else
pw = getpwuid((uid_t)tid);
@@ -879,7 +880,7 @@ int main(int argc, char **argv)
if (p) {
tmp = strsep (&p, ":");
- if (sscanf(tmp, "%d", &tid) != 1)
+ if (sscanf(tmp, "%d%1s", &tid, dummy) != 1)
gr = getgrnam(tmp);
else
gr = getgrgid((gid_t) tid);