Fix adding services to the boot runlevel, #43
This commit is contained in:
parent
486d517674
commit
79719b5386
@ -906,13 +906,14 @@ bool rc_service_add(const char *runlevel, const char *service)
|
||||
/* We need to ensure that only things in /etc/init.d are added
|
||||
* to the boot runlevel */
|
||||
if (strcmp (runlevel, RC_LEVEL_BOOT) == 0) {
|
||||
p = realpath(dirname(init), path);
|
||||
if (! *p) {
|
||||
free(init);
|
||||
p = realpath(dirname (init), path);
|
||||
if (! *p)
|
||||
return false;
|
||||
|
||||
retval = (strcmp(path, RC_INITDIR) == 0);
|
||||
if (! retval) {
|
||||
}
|
||||
if (strcmp(path, RC_INITDIR) != 0) {
|
||||
free(init);
|
||||
errno = EPERM;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user