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:
@ -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 (write(fd, "deny", 4) == -1)
|
||||
die("failed to write to /proc/self/setgroups");
|
||||
|
||||
close(fd);
|
||||
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");
|
||||
|
Reference in New Issue
Block a user