android-file-transfer-linux icon indicating copy to clipboard operation
android-file-transfer-linux copied to clipboard

Nodes mounted as root, removal possible as regular user

Open laur89 opened this issue 2 years ago • 1 comments

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.

laur89 avatar Jun 16 '22 11:06 laur89

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;

whoozle avatar Jul 10 '22 19:07 whoozle