Re: [gentoo-dev] Requirements for UID/GID management

2017-01-30 Thread Kristian Fiskerstrand
On 01/30/2017 07:22 PM, Michael Orlitzky wrote: > On 01/30/2017 01:05 PM, Patrick McLean wrote: >> >> No, that is also enabled by default on vanilla kernels, I just verified >> on my machine running a vanilla kernel. It doesn't matter anyway, since >> the permissions and ownership information is st

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-30 Thread Michael Orlitzky
On 01/30/2017 01:05 PM, Patrick McLean wrote: > > No, that is also enabled by default on vanilla kernels, I just verified > on my machine running a vanilla kernel. It doesn't matter anyway, since > the permissions and ownership information is stored in the inode, not > the dentry so all hardlinks

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-30 Thread Patrick McLean
On Mon, 30 Jan 2017 11:29:02 -0500 Michael Orlitzky wrote: > On 01/30/2017 09:25 AM, Alan McKinnon wrote: > >> > >> Any user can create a hard link in its home directory > >> to /etc/shadow, so long as (a) they live on the same filesystem, > >> and (b) there are no special kernel protections in p

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-30 Thread Michael Orlitzky
On 01/30/2017 09:25 AM, Alan McKinnon wrote: >> >> Any user can create a hard link in its home directory to /etc/shadow, so >> long as (a) they live on the same filesystem, and (b) there are no >> special kernel protections in place to prevent it. If you call chown on >> that hard link, it will cha

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-30 Thread Alan McKinnon
On 30/01/2017 01:04, Michael Orlitzky wrote: > On 01/29/2017 05:30 PM, Alan McKinnon wrote: >> >> Good catch with symlinks. >> I don't see the point about hardlinks, they are just files with 2 >> dentries. When find gets to the second one it's already changed, so no >> problem. >> > > Any user can

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/29/2017 06:34 PM, Ulrich Mueller wrote: > > Our syntax for package names is more restrictive than what POSIX > allows for a portable user name. Therefore, there could be user names > that are not representable. Have you checked if all user and group > names currently in use (at least in the

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Ulrich Mueller
> On Sun, 29 Jan 2017, Michael Orlitzky wrote: > I put together a draft of the "fixed UIDs with random fallback" model: > https://wiki.gentoo.org/wiki/User:Mjo/GLEP:User_packages > If we decide to fix UID/GID management, I think it would be a lot > easier to implement that draft than GLEP:

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/29/2017 05:30 PM, Alan McKinnon wrote: > > Good catch with symlinks. > I don't see the point about hardlinks, they are just files with 2 > dentries. When find gets to the second one it's already changed, so no > problem. > Any user can create a hard link in its home directory to /etc/shado

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Alan McKinnon
On 30/01/2017 00:20, Michael Orlitzky wrote: > On 01/29/2017 05:07 PM, Alan McKinnon wrote: >> >> Sure it can be done, just don't chown -R ~user. DO it the VERY >> long way round, file by file. Say you changed user "awesome" uid 300 to 400: >> >> find / -uid 300 -exec chown awesome {} \+ >> > > T

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/29/2017 05:07 PM, Alan McKinnon wrote: > > Sure it can be done, just don't chown -R ~user. DO it the VERY > long way round, file by file. Say you changed user "awesome" uid 300 to 400: > > find / -uid 300 -exec chown awesome {} \+ > That will find symlinks created by UID 300, and chown w

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/27/2017 12:54 PM, Michael Orlitzky wrote: > We approved GLEP 27 (https://wiki.gentoo.org/wiki/GLEP:27) in 2004 but > never implemented it. I'm wondering what are the explicit requirements > that we have for user and group management? > > What I'm really wondering is, instead of the proposal

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Alan McKinnon
On 29/01/2017 19:05, Michael Orlitzky wrote: > On 01/29/2017 03:26 AM, Alan McKinnon wrote: >>> >>> Can anyone think of an upgrade path for fixed UIDs? That issue aside, I >>> may have convinced myself that fixed UIDs are better. >> >> The general process I would recommend is that if the ebuild fin

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread james
On 01/29/2017 12:22 PM, A. Wilcox wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 29/01/17 11:05, Michael Orlitzky wrote: On 01/29/2017 03:26 AM, Alan McKinnon wrote: Can anyone think of an upgrade path for fixed UIDs? That issue aside, I may have convinced myself that fixed UIDs ar

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread James Le Cuirot
On Sun, 29 Jan 2017 11:16:50 -0600 "A. Wilcox" wrote: > On 28/01/17 13:32, James Le Cuirot wrote: > > On Sat, 28 Jan 2017 12:13:53 -0600 "A. Wilcox" > > wrote: > > > >> Having a file that user.eclass would use to map new users/groups > >> to IDs would be extremely beneficial to me. I was thi

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread A. Wilcox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 29/01/17 11:05, Michael Orlitzky wrote: > On 01/29/2017 03:26 AM, Alan McKinnon wrote: >>> >>> Can anyone think of an upgrade path for fixed UIDs? That issue >>> aside, I may have convinced myself that fixed UIDs are better. >> >> The general pr

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/29/2017 05:03 AM, Ulrich Mueller wrote: >> On Sat, 28 Jan 2017, Michael Orlitzky wrote: > >> [...] sys-user/echo [...] > > [Replying to a random message in this thread, as I have some backlog.] > > Users and groups aren't packages, so IMHO packages and *DEPEND > variables shouldn't be

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread A. Wilcox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 28/01/17 13:32, James Le Cuirot wrote: > On Sat, 28 Jan 2017 12:13:53 -0600 "A. Wilcox" > wrote: > >> Having a file that user.eclass would use to map new users/groups >> to IDs would be extremely beneficial to me. I was thinking about >> diving

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michael Orlitzky
On 01/29/2017 03:26 AM, Alan McKinnon wrote: >> >> Can anyone think of an upgrade path for fixed UIDs? That issue aside, I >> may have convinced myself that fixed UIDs are better. > > The general process I would recommend is that if the ebuild finds the user > already exists, leave it, it's UID an

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Michał Górny
On Sun, 29 Jan 2017 11:03:25 +0100 Ulrich Mueller wrote: > > On Sat, 28 Jan 2017, Michael Orlitzky wrote: > > > [...] sys-user/echo [...] > > [Replying to a random message in this thread, as I have some backlog.] > > Users and groups aren't packages, so IMHO packages and *DEPEND > vari

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Ulrich Mueller
> On Sat, 28 Jan 2017, Michael Orlitzky wrote: > [...] sys-user/echo [...] [Replying to a random message in this thread, as I have some backlog.] Users and groups aren't packages, so IMHO packages and *DEPEND variables shouldn't be abused for things like that. This has been discussed in bug

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-29 Thread Alan McKinnon
On 29/01/2017 03:56, Michael Orlitzky wrote: > On 01/27/2017 11:21 PM, Rich Freeman wrote: >> >> It isn't like inconsistent UIDs are the end of the world. However, >> IMO it still makes sense to at least try to standardize such things. >> Really, if you have a package always installing the same us

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Michael Orlitzky
On 01/28/2017 10:23 PM, Gordon Pettey wrote: > > That's nonsense for reasons already mentioned by rich0. UIDs don't change > except in the case of an admin doing it manually. > It shouldn't be common, but it can and will happen once you put users in ebuilds. As an example, imagine an "echo" daem

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread M. J. Everitt
On 29/01/17 03:23, Gordon Pettey wrote: > On Sat, Jan 28, 2017 at 8:54 PM, Michael Orlitzky > wrote: > > On 01/28/2017 09:22 PM, Rich Freeman wrote: > > > > Honestly, I really will say "so what" here. :) > > > > I forgot to mention a few of the advantag

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Gordon Pettey
On Sat, Jan 28, 2017 at 8:54 PM, Michael Orlitzky wrote: > On 01/28/2017 09:22 PM, Rich Freeman wrote: > > > > Honestly, I really will say "so what" here. :) > > > > I forgot to mention a few of the advantages of having really-fixed UIDs. > First, it makes the code simpler. Yup, cool. > > It als

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread M. J. Everitt
On 29/01/17 01:56, Michael Orlitzky wrote: > On 01/27/2017 11:21 PM, Rich Freeman wrote: >> It isn't like inconsistent UIDs are the end of the world. However, >> IMO it still makes sense to at least try to standardize such things. >> Really, if you have a package always installing the same user si

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Michael Orlitzky
On 01/28/2017 09:22 PM, Rich Freeman wrote: > > Honestly, I really will say "so what" here. :) > I forgot to mention a few of the advantages of having really-fixed UIDs. First, it makes the code simpler. Yup, cool. It also lets us play a nice trick and use the UID as a subslot, so that if some

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Michael Orlitzky
On 01/28/2017 09:22 PM, Rich Freeman wrote: >> >> Here's a problem I have no solution for. Suppose we tell everyone to >> pick a fixed UID for their user packages. I have a randomly assigned >> "tcpdump" user as UID 102 on my machine today. If we roll this out next >> week and the tcpdump maintaine

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Rich Freeman
On Sat, Jan 28, 2017 at 8:56 PM, Michael Orlitzky wrote: > On 01/27/2017 11:21 PM, Rich Freeman wrote: >> >> It isn't like inconsistent UIDs are the end of the world. However, >> IMO it still makes sense to at least try to standardize such things. >> Really, if you have a package always installin

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Michael Orlitzky
On 01/27/2017 11:21 PM, Rich Freeman wrote: > > It isn't like inconsistent UIDs are the end of the world. However, > IMO it still makes sense to at least try to standardize such things. > Really, if you have a package always installing the same user simply > sticking a default UID without any eff

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Patrick McLean
On Sat, 28 Jan 2017 11:28:45 + James Le Cuirot wrote: > On Fri, 27 Jan 2017 18:37:52 -0800 > Patrick McLean wrote: > > > I don't think we need to have stable UIDs/GIDs in the "normal" case of > > standalone users with a single Gentoo system at home. The people who > > need predictable UIDs/

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread James Le Cuirot
On Sat, 28 Jan 2017 15:34:01 -0500 Rich Freeman wrote: > On Sat, Jan 28, 2017 at 2:32 PM, James Le Cuirot wrote: > > On Sat, 28 Jan 2017 12:13:53 -0600 > > "A. Wilcox" wrote: > > > >> Having a file that user.eclass would use to map new users/groups to > >> IDs would be extremely beneficial to

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Rich Freeman
On Sat, Jan 28, 2017 at 2:32 PM, James Le Cuirot wrote: > On Sat, 28 Jan 2017 12:13:53 -0600 > "A. Wilcox" wrote: > >> Having a file that user.eclass would use to map new users/groups to >> IDs would be extremely beneficial to me. I was thinking about diving >> in to that some time later, after

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread James Le Cuirot
On Sat, 28 Jan 2017 12:13:53 -0600 "A. Wilcox" wrote: > Having a file that user.eclass would use to map new users/groups to > IDs would be extremely beneficial to me. I was thinking about diving > in to that some time later, after the GLEP 70 work I'm doing, but if > someone else wants to take i

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread A. Wilcox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 27/01/17 20:37, Patrick McLean wrote: > I don't think we need to have stable UIDs/GIDs in the "normal" case > of standalone users with a single Gentoo system at home. The people > who need predictable UIDs/GIDs are the "enterprise" users or the >

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread Tom H
On Fri, Jan 27, 2017 at 1:52 PM, Rich Freeman wrote: > > Just have a table somewhere (wiki?) to track who is using what UID/GID > and encode those defaults into the ebuild that creates those users. FYI, how Debian and Fedora do it: Debian policy https://www.debian.org/doc/debian-policy/ch-opersy

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-28 Thread James Le Cuirot
On Fri, 27 Jan 2017 18:37:52 -0800 Patrick McLean wrote: > I don't think we need to have stable UIDs/GIDs in the "normal" case of > standalone users with a single Gentoo system at home. The people who > need predictable UIDs/GIDs are the "enterprise" users or the home users > who use things such

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Rich Freeman
On Fri, Jan 27, 2017 at 9:37 PM, Patrick McLean wrote: > > I don't think we need to have stable UIDs/GIDs in the "normal" case of > standalone users with a single Gentoo system at home. Of course, but as you point out the enterprise case has more sophisticated solutions. I think the case of some

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michael Orlitzky
On 01/27/2017 09:37 PM, Patrick McLean wrote: > > To make something to solve our problem (and I suspect everyone > else who cares about this), it would be sufficient to have a mechanism > to override the default random assignment with a fixed UID/GID. What I had in mind for this is that a "normal

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Patrick McLean
On Fri, 27 Jan 2017 14:53:18 -0500 Rich Freeman wrote: > On Fri, Jan 27, 2017 at 2:35 PM, Michael Orlitzky > wrote: > > On 01/27/2017 01:52 PM, Rich Freeman wrote: > >> > >> This doesn't really seem like a problem though. Just have a table > >> somewhere (wiki?) to track who is using what UID

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michael Orlitzky
On 01/27/2017 04:15 PM, Michał Górny wrote: > >> * users-update: cleanup can be done with --depclean now. > > Err, cleanup is never easy. You shouldn't really remove a user if it > owns any files. I guess you could abuse pkg_prerm() for that but > depclean will be terribly slow then. > What ar

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Rich Freeman
On Fri, Jan 27, 2017 at 3:09 PM, Michael Orlitzky wrote: > My first impression is that any package that doesn't care > about its UID should default to "first available", but if that causes > problems, then that's exactly the sort of use case I'm looking for. > The ones I listed before were filesy

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michał Górny
On Fri, 27 Jan 2017 12:54:07 -0500 Michael Orlitzky wrote: > We approved GLEP 27 (https://wiki.gentoo.org/wiki/GLEP:27) in 2004 but > never implemented it. I'm wondering what are the explicit requirements > that we have for user and group management? I don't think GLEP 27 could be really conside

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michael Orlitzky
On 01/27/2017 02:53 PM, Rich Freeman wrote: > > I'm not saying we can't have random assignment for things where it > doesn't matter, or fall back to random assignment, but it seems rather > silly to go to all the trouble to have blockers when it would be just > as easy to not have a conflict in th

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Rich Freeman
On Fri, Jan 27, 2017 at 2:35 PM, Michael Orlitzky wrote: > On 01/27/2017 01:52 PM, Rich Freeman wrote: >> >> This doesn't really seem like a problem though. Just have a table >> somewhere (wiki?) to track who is using what UID/GID and encode those >> defaults into the ebuild that creates those us

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Gregory Woodbury
On Fri, Jan 27, 2017 at 1:52 PM, Rich Freeman wrote: > On Fri, Jan 27, 2017 at 12:54 PM, Michael Orlitzky wrote: > > > > You don't really have to care what UID/GID is assigned, because each > > user/group will only be created once and referenced by name (as $PN). By > > default, we could pick th

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michael Orlitzky
On 01/27/2017 01:52 PM, Rich Freeman wrote: > > This doesn't really seem like a problem though. Just have a table > somewhere (wiki?) to track who is using what UID/GID and encode those > defaults into the ebuild that creates those users. > It should be possible to have two different users with

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Rich Freeman
On Fri, Jan 27, 2017 at 12:54 PM, Michael Orlitzky wrote: > > You don't really have to care what UID/GID is assigned, because each > user/group will only be created once and referenced by name (as $PN). By > default, we could pick the first available UID in most packages. I might be not following

Re: [gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Alexis Ballier
On Fri, 27 Jan 2017 12:54:07 -0500 Michael Orlitzky wrote: > That satisfies most of the requirements that *I* have for user and > group management on the system. Compared to the GLEP: > > * EUSERS + EGROUPS: replaced by (R)DEPEND. > * Defining Accounts: anyone can add a new package already.

[gentoo-dev] Requirements for UID/GID management

2017-01-27 Thread Michael Orlitzky
We approved GLEP 27 (https://wiki.gentoo.org/wiki/GLEP:27) in 2004 but never implemented it. I'm wondering what are the explicit requirements that we have for user and group management? What I'm really wondering is, instead of the proposal in GLEP27, if we couldn't simply handle users like any oth