1 |
On Wed, Jan 10, 2018 at 03:25:55PM -0500, Michael Orlitzky wrote: |
2 |
> On 01/10/2018 01:04 PM, William Hubbs wrote: |
3 |
> > On Tue, Jan 09, 2018 at 08:19:24PM -0500, Michael Orlitzky wrote: |
4 |
> > |
5 |
> >> Ultimately, it's not safe to chown/chmod/setfacl/whatever in a directory |
6 |
> >> that is not writable only by yourself and root. |
7 |
> > |
8 |
> > Let me try to phrase this another way. |
9 |
> > |
10 |
> > If the directory we are in is not owned by us or root and is group or |
11 |
> > world writable, checkpath should not change the ownership or permissions |
12 |
> > of the file passed to it. |
13 |
> |
14 |
> There are also POSIX ACLs, NFSv4 ACLs, and god-knows-what-else to worry |
15 |
> about, but the above is a good start. |
16 |
> |
17 |
> |
18 |
> >> Here's a very tedious proposal for OpenRC: ... |
19 |
> >> |
20 |
> >> 2. Have newpath throw a warning if it's used in a directory that is |
21 |
> >> writable by someone other than root and the OpenRC user. This will |
22 |
> >> prevent people from creating /foo/bar after /foo has already been |
23 |
> >> created with owner "foo:foo". In other words, service script |
24 |
> >> writers will be encouraged to do things in a safe order. Since |
25 |
> >> we're starting over, this might even be made an error. |
26 |
> > |
27 |
> > I'm not really a fan of creating a new helper unless I have to; I would |
28 |
> > rather modify checkpath's behaviour. |
29 |
> > |
30 |
> > The first stage of that modification would be to release a version that |
31 |
> > outputs error messages, then convert the error messages to hard failures |
32 |
> > in a later release. |
33 |
> > |
34 |
> > Is this reasonable? If we go this route, what should checkpath start |
35 |
> > complaining about? |
36 |
> |
37 |
> /* |
38 |
> Disclaimer: I'm not even sure that this difficult proposal will solve |
39 |
> the problem. Moreover there may be legitimate things going on in some |
40 |
> init scripts that I haven't accounted for. |
41 |
> */ |
42 |
> |
43 |
> The downside to keeping the name "checkpath" is that it makes it |
44 |
> difficult to identify unfixed scripts. If we change the name, then "grep |
45 |
> -rl checkpath" points them out for you; but if checkpath is modified, |
46 |
> you have to install the package and attempt to start/stop/save/reload it |
47 |
> and look for warnings. |
48 |
|
49 |
Good point, this may be a good reason to make a new helper and deprecate |
50 |
checkpath. What I would do is make checkpath throw an error but keep |
51 |
running,. It would have a message, something like: |
52 |
|
53 |
"Checkpath is deprecated, please use newpath instead." |
54 |
|
55 |
What are we saying newpath should do differently than checkpath if I |
56 |
go this route? |
57 |
|
58 |
William |