android-file-transfer-linux
android-file-transfer-linux copied to clipboard
Nodes mounted as root, removal possible as regular user
Hi, I mounted the phone and got an error:
aft-mtp-mount ./phone/
Device::Find failed:Device is already used by another process
Having assumed the mount failed, I deleted the mountpoint:
rm -rf ./phone/
Turns out the mount had not failed, and data was lost.
How is it possible that rm
succeeded? Mounting and traversing the file-tree shows all the directories-files are owned by root
, and others
have only read access.
Running android-file-transfer 4.2-1 on Debian testing. Android 11.
Interesting, fuse does not (did not?) allow other users to do anything with mounted directory by default. What fuse version do you have? Did you pass -o allow_other
to mount?
With fuse you don't have to do wrt permissions, they are returned as a part of stat structure. Modes for Files/Directories are :
static constexpr unsigned FileMode = S_IFREG | 0644;
static constexpr unsigned DirectoryMode = S_IFDIR | 0755;