We need to check for contents of argv too.
This commit is contained in:
parent
d904acf448
commit
b0442b3193
@ -351,7 +351,7 @@ bool rc_service_daemon_set (const char *service, const char *const *argv,
|
|||||||
DIR *dp;
|
DIR *dp;
|
||||||
struct dirent *d;
|
struct dirent *d;
|
||||||
|
|
||||||
if (! argv && ! name && ! pidfile) {
|
if (! (argv && *argv) && ! name && ! pidfile) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ bool rc_service_daemon_set (const char *service, const char *const *argv,
|
|||||||
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons",
|
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons",
|
||||||
basename_c (service), (char *) NULL);
|
basename_c (service), (char *) NULL);
|
||||||
|
|
||||||
if (argv) {
|
if (argv && *argv) {
|
||||||
l = strlen (*argv) + 6;
|
l = strlen (*argv) + 6;
|
||||||
mexec = xmalloc (sizeof (char) * l);
|
mexec = xmalloc (sizeof (char) * l);
|
||||||
snprintf (mexec, l, "exec=%s", *argv);
|
snprintf (mexec, l, "exec=%s", *argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user