[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-8.2 bug-fix-only release coming soon
From: |
Ludovic Courtès |
Subject: |
Re: coreutils-8.2 bug-fix-only release coming soon |
Date: |
Sun, 06 Dec 2009 18:30:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi Jim,
Jim Meyering <address@hidden> writes:
> The trouble is that this code appears to be doing incomplete
> "su" emulation, in that it does not set the supplementary groups.
Actually the intent of this snippet was to mimic Nix’ build process:
https://svn.nixos.org/repos/nix/nix/trunk/src/libstore/build.cc
Specifically this part:
--8<---------------cut here---------------start------------->8---
if (setgroups(0, 0) == -1)
throw SysError("cannot clear the set of supplementary groups");
if (setgid(buildUser.getGID()) == -1 ||
getgid() != buildUser.getGID() ||
getegid() != buildUser.getGID())
throw SysError("setgid failed");
if (setuid(buildUser.getUID()) == -1 ||
getuid() != buildUser.getUID() ||
geteuid() != buildUser.getUID())
throw SysError("setuid failed");
--8<---------------cut here---------------end--------------->8---
I guess one way to fix it would be to have /etc/{passwd,group} match
this code. I’ll see what can be done.
Thanks,
Ludo’.