In the current implementation, in case of execl("/sbin/restorecon")
failing, the child process will also return and that will lead to
even more disasterous effects.
Though it seems unlikely that execl() would fail given that the file
exists, simply catch that case by exiting in case execl() returns.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
restorecon_pid = fork();
if (!restorecon_pid)
- execl("/sbin/restorecon", "restorecon", overlaydir, (char *) NULL);
+ exit(execl("/sbin/restorecon", "restorecon", overlaydir, (char *) NULL));
else if (restorecon_pid > 0)
waitpid(restorecon_pid, &status, 0);
}