From b3b861c1ac307cfe324c7295710e13060e6d1c9d Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Tue, 23 Nov 1999 20:48:25 +0000 Subject: [PATCH] Add strdup to start-stop-daemon --- utils/start-stop-daemon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 3e739627..bf47531b 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -311,7 +311,10 @@ parse_options(int argc, char * const *argv) execname = optarg; break; case 'c': /* --chuid | */ - 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 */ -- 2.39.5