Gentoo Archives: gentoo-dev

From: Christopher Head <chead@×××××.ca>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Requirements for UID/GID management
Date: Sat, 04 Feb 2017 08:50:51
Message-Id: 20170204005038.6148d654@amdahl.home.chead.ca
In Reply to: Re: [gentoo-dev] Re: Requirements for UID/GID management by Michael Orlitzky
1 On Fri, 3 Feb 2017 14:29:04 -0500
2 Michael Orlitzky <mjo@g.o> wrote:
3
4 > > However, it is no rocket science to write a race-free chown command
5 > > in C: Just open the file and use stat() and fchown() to be sure to
6 > > change only files from the "correct" user.
7 > >
8 > > Since this works on the filehandle and not on the filename, I think
9 > > that there is no possibility for an exploit when this is used in the
10 > > above find loop.
11 >
12 > Not a bad idea... we chould ship that safe-chown utility, and then
13 > tell users how to use it to fix their UIDs. The draft that I wrote up
14 > was for the "fixed UID with random fallback" model, but said utility
15 > could still be useful for people who want to change their running
16 > systems to use the same UIDs that would have been chosen by default.
17
18 Are you sure that said utility isn’t simply “chown --from”?
19 --
20 Christopher Head

Replies

Subject Author
Re: [gentoo-dev] Re: Requirements for UID/GID management Michael Orlitzky <mjo@g.o>
[gentoo-dev] Re: Requirements for UID/GID management Martin Vaeth <martin@×××××.de>