aboutsummaryrefslogtreecommitdiff
path: root/src/rc/start-stop-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/start-stop-daemon.c')
-rw-r--r--src/rc/start-stop-daemon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index aafada88..99e5b6a0 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -389,10 +389,11 @@ int main(int argc, char **argv)
/* falls through */
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);
@@ -413,7 +414,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);