Nemo can erase a folder containing an immutable file

Open
#3,487 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start by reproducing the issue on a Linux filesystem with an immutable file, following the listed terminal and Nemo steps. Trace Nemo's move-to-trash and empty-trash paths, then verify that an immutable file remains protected and that the relevant operation is denied, matching terminal behavior.

Written by the indexing model from the issue text.

Description

Distribution

Mint 21.3

Package version

6.0.2

Frequency

Always

Bug description

From Nemo, the folder containing an immutable file can be sent to the trash bin and, then, the trash bin can be emptied!

From the terminal you cannot remove the folder, even as root.
Here I make the file immutable and try to remove its containing folder which is denied as is expected:

~/folder$ mkdir test-folder

~/folder$ cd test-folder

~/folder/test-folder$ touch file

~/folder/test-folder$ ls 
file

~/folder/test-folder$ sudo chattr +i file
[sudo] Mot de passe de philippe : 
      
~/folder/test-folder$ lsattr
----i---------e------- ./file

~/folder/test-folder$ cd ..

~/folder$ rm -r test-folder
rm: impossible de supprimer 'test-folder/file': Opération non permise
rm: impossible de supprimer 'test-folder': Le dossier n'est pas vide

~/folder$ sudo rm -r test-folder
rm: impossible de supprimer 'test-folder/file': Opération non permise

Immediately after all this I went to Nemo, tried to completely erase test-folder and it was denied BUT THEN tried to move it to the trash bin and it worked!

I went to the trash bin and clicked on "Empty the trash bin" and it worked and the immutable file had been definitely erased.

Actually one can find the file erased in ~/.local/share/trash/expunged/nnnnnnnnnnn/
nnn… being a number of digits.

Either the transfer to the trash bin of a folder containing an immutable file or the emptying of the bin should be denied as is the case when one try to erase the folder from the terminal.

Steps to reproduce
  1. Create a folder and in it a file.
  2. Set the immutable attribute to the file (sudo chattr +i file).
  3. In Nemo send the folder containing the immutable file to the trash bin.
  4. Empty the trash bin.
  5. The so-called « immutable » file has been deleted!
Expected behavior

Either the transfer to the trash bin of a folder containing an immutable file or the emptying of the bin should be denied as is the case when one try to erase the folder from the terminal.

Additional information

I can reproduce the abnormal behaviour of Nemo (not respecting the extended attributes of the filesystem, ext4 here) in Debian 12 Cinnamon.

Dominant language
C
Stars
1.6k
Forks
368
Avg merge
4d 4h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxmint/nemo

All issues in linuxmint/nemo

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.