Unverified Commit 3e0aac16 by Stéphane Graber Committed by GitHub

Merge pull request #2829 from brauner/2019-02-08/capabilities

caps: check uid and euid
parents f57860ac df9bf8ca
......@@ -136,8 +136,7 @@ int lxc_ambient_caps_up(void)
int last_cap = CAP_LAST_CAP;
char *cap_names = NULL;
/* When we are root, we don't want to play with capabilities. */
if (!getuid())
if (!getuid() || geteuid())
return 0;
caps = cap_get_proc();
......@@ -204,8 +203,7 @@ int lxc_ambient_caps_down(void)
cap_t caps;
cap_value_t cap;
/* When we are root, we don't want to play with capabilities. */
if (!getuid())
if (!getuid() || geteuid())
return 0;
ret = prctl(PR_CAP_AMBIENT, prctl_arg(PR_CAP_AMBIENT_CLEAR_ALL),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment