Comment on Every time i have to use windows again my IQ slips a point or two

skullgiver@popplesburger.hilciferous.nl ⁨1⁩ ⁨year⁩ ago

Always fun to see people with limited understanding of ACLs struggle with filesystems that apply them.

Windows has a lot of features built in to prevent users (and malware) from breaking their system, such as the “system” and “read only” flags. I suppose explorer could’ve asked you to elevate, unset any flags, alter ownership, and delete anyway, but that’s doing a lot of work you don’t necessarily intend to do when you click “delete”.

Linux has this too; try the following:

mkdir -p /tmp/test/deleteme;
touch /tmp/test/deleteme/deleteme.txt;
chattr +i /tmp/test/deleteme /tmp/test/deleteme/deleteme.txt
# If you want to apply the "drive from different system" equivalence
sudo chown -R 12345:12345 /tmp/test/deleteme

Now try deleting the folder /tmp/test/deleteme from your file explorer:

A screenshot of Gnome’s Nautilus telling the user that they do not have the necessary permissions to remove the folder “deleteme”

Frustrated, you may try to force the issue by forcefully removing the file through the terminal:

user@box /tmp/test $ sudo rm -rf deleteme
Place your finger on the fingerprint reader
rm: cannot remove 'deleteme/deleteme.txt': Operation not permitted 
user@box /tmp/test $

Alright, what if I…

user@box /tmp/test $ sudo -i
Place your finger on the fingerprint reader
root@box ~ $ cd /tmp/test
root@box /tmp/test $ rm -rf deleteme
rm: cannot remove 'deleteme/deleteme.txt': Operation not permitted
root@box /tmp/test $ whoami
root

The only way to get rid of these files, is to set the right flags:

user@box /tmp/test $ chattr -i deleteme deleteme/deleteme.txt
user@box /tmp/test $ rm -rf deleteme

source
Sort:hotnewtop