Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: ideas for fixing OpenRC checkpath issue
Date: Sat, 20 Jan 2018 01:21:00
Message-Id: 5597b7ed-1034-af38-4063-b4cb5201e96d@gentoo.org
In Reply to: Re: [gentoo-dev] rfc: ideas for fixing OpenRC checkpath issue by William Hubbs
1 On 01/19/2018 08:14 PM, William Hubbs wrote:
2 >>
3 >> Why not? Since /var/lib is root:root and mode 755, we can create
4 >> /var/lib/foo while running --as=root (the default). Then afterwards,
5 >> anything beneath /var/lib/foo would need to be created "--as" the owner
6 >> of that directory.
7 >
8 > That would create an extra level of indirection for some things though,
9 > what if /var/lib/foo needs to be owned by foo? I have /var/lib/dhcp
10 > which is owned by dhcp:dhcp. You can't creat that with --as=dhcp.
11 >
12
13 The same way you do it now:
14
15 newpath --directory /var/lib/dhcp --owner dhcp:dhcp
16
17 There's no new obstacle, because /var/lib is writable only by root and
18 the current OpenRC user (also root, in this case).
19
20 Now if you need /var/lib/dhcp/something-else to be owned by dhcp:dhcp,
21 *then* you would do it --as=dhcp.