We don't want to drop the capabilities when we are root because that
leads to some problems. For exemple, sudo lxc-start -n foo -o $(tty) fails with
"permission denied".
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
cap_t caps;
int ret;
+ /* when we are run as root, we don't want to play
+ * with the capabilities */
+ if (!getuid())
+ return 0;
+
caps = cap_get_proc();
if (!caps) {
ERROR("failed to cap_get_proc: %m");
cap_value_t cap;
int ret;
+ /* when we are run as root, we don't want to play
+ * with the capabilities */
+ if (!getuid())
+ return 0;
+
caps = cap_get_proc();
if (!caps) {
ERROR("failed to cap_get_proc: %m");