[TUHS] rm command
Michael Kjörling
michael at kjorling.se
Sun Apr 29 02:33:51 AEST 2018
On 27 Apr 2018 11:17 -0700, from pete at nomadlogic.org (Pete Wright):
>>> On my FreeBSD server:
>>>
>>> % ls -l /bin/ps
>>> -r-xr-xr-x 1 root wheel 35640 Oct 15 2017 /bin/ps
>>>
>>> On my crappy MacBook:
>>>
>>> % ls -l /bin/ps
>>> -rwsr-xr-x 1 root wheel 51200 Jul 15 2017 /bin/ps
>>
>> Debian 9:
>>
>> nicci at jesustheasus:~$ ls -l $(which ps)
>> -rwxr-xr-x 1 root root 129336 Nov 22 2016 /bin/ps
>>
>> Debian 8 kFreeBSD:
>>
>> [usotsuki at licca ~]$ ls -l $(which ps)
>> -rwxr-xr-x 1 root root 93088 Mar 6 2015 /bin/ps
Debian 7 is the same, except /bin/ps is 93120 bytes there.
> interesting how the gnu userland marks ps as owner-writable, not
> sure it matters, but interesting...
That's more likely the package manager, or the packaging done by the
package maintainer, than it is anything about GNU per se.
I've got a gazillion 0755 0:0 binaries on my system. In fact, running
`ls -l /usr/bin | grep -v '^.rwx'` on my desktop Debian box returns
only a handful of hits, all of which are u=rws and a few of which are
g=r-s.
If you're root enough to take advantage of the owner-writable bit on a
file owned by root, then you're root enough to make quite a mess even
if they were mode 0555 or even 0111.
If you want weird, then tell me why on Earth /bin/ping _really_ needs
to be setuid root on Linux (has no one heard of capabilities?), or why
/bin/fusermount is, of all modes they could choose from, `-rwsr-xr--`.
--
Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se
“The most dangerous thought that you can have as a creative person
is to think you know what you’re doing.” (Bret Victor)
More information about the TUHS
mailing list