[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where to report: root fails to edit other users file in sticky bit directory



On Fri, Dec 04, 2020 at 02:40:02PM +0100, MichaIng wrote:
> Hi Debian team,
> 
> I'm sorry to contact you here, but I ran into an IMO extremely
> important bug where I don't know which package is actually
> responsible.
> 
> Even the root user is not permitted to write to an existing file
> that is owned by another user within a sticky bit directory:
> -------
> 2020-12-04 14:16:58 root@micha:/tmp# whoami
> root
> 2020-12-04 14:17:07 root@micha:/tmp# ls -dl
> drwxrwxrwt 5 root root 100 Dec  4 14:17 .
> 2020-12-04 14:17:10 root@micha:/tmp# > testfile
> 2020-12-04 14:17:13 root@micha:/tmp# chown nobody testfile
> 2020-12-04 14:17:17 root@micha:/tmp# chmod 0777 testfile
> 2020-12-04 14:17:21 root@micha:/tmp# ls -l testfile
> -rwxrwxrwx 1 nobody root 0 Dec  4 14:17 testfile
> 2020-12-04 14:17:23 root@micha:/tmp# > testfile
> bash: testfile: Permission denied
> 2020-12-04 14:17:26 root@micha:/tmp# rm -v testfile
> removed 'testfile'
> 2020-12-04 14:17:31 root@micha:/tmp# ls -l testfile
> ls: cannot access 'testfile': No such file or directory

Can't reproduce it here. Could it be that your shell tries
to remove `testfile' when you do the redirection `>'?

FWIW my shell is bash.

Try appending to `testfile' with `>>'.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


Reply to: