Gentoo Archives: gentoo-user

From: Laurence Perkins <lperkins@×××××××.net>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: RE: [gentoo-user] Re: Root can't write to files owned by others?
Date: Fri, 11 Mar 2022 16:41:35
Message-Id: DM5PR07MB40551ADAF8C879092485A130D20C9@DM5PR07MB4055.namprd07.prod.outlook.com
In Reply to: Re: [gentoo-user] Re: Root can't write to files owned by others? by Neil Bothwick
1 >-----Original Message-----
2 >From: Neil Bothwick <neil@××××××××××.uk>
3 >Sent: Friday, March 11, 2022 6:59 AM
4 >To: gentoo-user@l.g.o
5 >Subject: Re: [gentoo-user] Re: Root can't write to files owned by others?
6 >
7 >On Fri, 11 Mar 2022 12:38:48 +0100, Dr Rainer Woitok wrote:
8 >
9 >> No. My "/tmp/" directory is not mounted at all, it is just a genuine
10 >> directory in "/". And that root CAN overwrite a file it doesn't own in
11 >> other directories, is due to most directories not having the sticky
12 >> bit set (which is a (wanted) particularity of "/tmp/" and
13 >> "/var/tmp/", in that it prevents normal users from (re)moving other people's files):
14 >
15 >It's not the sticky bit per se from what I've read, but the new default prevents root from overwriting a file if the file and the directory containing it have different owners. In most cases, the file has the same directory as the owner so this does not happen, but the sticky bit allows users that don't own the directory to create files in it.
16 >
17 I was just looking at the patch. In at least one of its modes I think it's specifically looking for the sticky bit on the directory. I didn't think to pay attention to what the new default setting ends up doing for which specific mode it goes with.
18
19 LMP