service_register(): guard against loss of command args

We use strtok() quite extensively in .conf parser.  Parsing of a service
line is split in two, with the command arguments being parsed very late.

Adding a new sub-option parser, based on strtok(), risk losing command
arguments.  Thus, change to use strtok_r() so that we always know where
the arg parser is.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-12-18 14:43:51 +01:00
1 parent 8b5435908c
commit 0e04ffd68f
3 files changed
+14 -17

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ char *tty_canonicalize (char *dev);
int tty_isatcon (char *dev);
char *tty_atcon (void);
int tty_parse_args (char *cmdline, struct tty *tty);
int tty_parse_args (struct tty *tty, char *cmd, char **args);
int tty_exists (char *dev);
int tty_exec (svc_t *tty);