diff --git a/NEWS b/NEWS index 1758510b..40275547 100644 --- a/NEWS +++ b/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. diff --git a/bin/xbps-uunshare/main.c b/bin/xbps-uunshare/main.c index c964c373..f2523eae 100644 --- a/bin/xbps-uunshare/main.c +++ b/bin/xbps-uunshare/main.c @@ -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");