]> err.no Git - dpkg/commitdiff
Add strdup to start-stop-daemon
authorWichert Akkerman <wakkerma@debian.org>
Tue, 23 Nov 1999 20:48:25 +0000 (20:48 +0000)
committerWichert Akkerman <wakkerma@debian.org>
Tue, 23 Nov 1999 20:48:25 +0000 (20:48 +0000)
utils/start-stop-daemon.c

index 3e739627dc6eeeb165d70fd3ede18f953f934f4f..bf47531bad1d4891ef4b95f1e1678a9ea69b00be 100644 (file)
@@ -311,7 +311,10 @@ parse_options(int argc, char * const *argv)
                        execname = optarg;
                        break;
                case 'c':  /* --chuid <username>|<uid> */
-                       changeuser = strtok(optarg, ":");
+                       /* we copy the string just in case we need the
+                        * argument later. */
+                       changeuser = strdup(optarg);
+                       changeuser = strtok(changeuser, ":");
                        changegroup = strtok(NULL, ":");
                        break;
                case 'b':  /* --background */