mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 08:05:20 +00:00
Merge pull request #2829 from brauner/2019-02-08/capabilities
caps: check uid and euid
This commit is contained in:
commit
3e0aac16db
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user