xbps-uunshare: do not fail if /proc/self/setgroups does not exist.
3.16 supports user_namespaces(7) but does not have /proc/self/setgroups. Found by @cheneukirchen.
This commit is contained in:
parent
be363d93f5
commit
1597727814
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
||||
xbps-0.44.1 (???):
|
||||
|
||||
* xbps-uunshare(8): do not fail if we cannot disable setgroups; some kernels
|
||||
might not support it. Found by @cheneukirchen on 3.16.
|
||||
|
||||
* xbps-reconfigure(8): added -i/--ignore to usage(), by Christian Neukirchen.
|
||||
|
||||
* Updated zsh completions, by Christian Neukirchen.
|
||||
|
@ -147,12 +147,11 @@ main(int argc, char **argv)
|
||||
|
||||
close(fd);
|
||||
|
||||
if ((fd = open("/proc/self/setgroups", O_RDWR)) == -1)
|
||||
die("failed to open /proc/self/setgroups rw");
|
||||
if ((fd = open("/proc/self/setgroups", O_RDWR)) == 0) {
|
||||
if (write(fd, "deny", 4) == -1)
|
||||
die("failed to write to /proc/self/setgroups");
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
if ((fd = open("/proc/self/gid_map", O_RDWR)) == -1)
|
||||
die("failed to open /proc/self/gid_map rw");
|
||||
|
Loading…
Reference in New Issue
Block a user