Describe the bug
Due to a change in how os.makedirs(...) works in Python 3.7 and above, when you create ~/.local/share/Trash/files folder or $rootdir/Trash/$uid/files folder, the ~/.local/share/Trash/$rootdir/.Trash/$uid folder does not use 700 for its permissions.
Similarly, when using different volume for / and /home, /Trash/$uid folder has wrong permissions as well (this output is from my actual OS to show how it works with multiple volumes which is the reason why the perms are a bit different - I have a different umask from the one in the container I tested in):
Describe the bug Due to a change in how
os.makedirs(...)
works in Python 3.7 and above, when you create~/.local/share/Trash/files
folder or$rootdir/Trash/$uid/files
folder, the~/.local/share/Trash
/$rootdir/.Trash/$uid
folder does not use 700 for its permissions.Relevant change: https://github.com/python/cpython/commit/e304e33c16e060932d1e2cc8a030d42b02b429b5
trash-cli version
trash-put 0.22.4.16
Operating system:
To Reproduce
I probably wouldn't suggest actually removing your whole trash directory just to test this, I used a container to make it easier for me to test :)
Similarly, when using different volume for
/
and/home
,/Trash/$uid
folder has wrong permissions as well (this output is from my actual OS to show how it works with multiple volumes which is the reason why the perms are a bit different - I have a different umask from the one in the container I tested in):Expected behavior I expected
ls -al ~/.local/share/Trash
to return:Additional information This causes KDE to treat such directory as insecure:
https://github.com/KDE/kio/blob/7f02360d9d47bc734941415b57cacefe6bf6a755/src/ioslaves/trash/trashimpl.cpp#L1125-L1134