Remove the CAP_SYS_BOOT capability from the bouding set, so we can poweroff,
halt, reboot the container safely without shutting down the real host.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/prctl.h>
+#include <sys/capability.h>
#include <sys/wait.h>
#include <lxc/lxc.h>
goto out_child;
}
+ if (prctl(PR_CAPBSET_DROP, CAP_SYS_BOOT, 0, 0, 0)) {
+ lxc_log_syserror("failed to remove CAP_SYS_BOOT capability");
+ goto out_child;
+ }
+
execvp(argv[0], argv);
lxc_log_syserror("failed to exec %s", argv[0]);