whoozle / android-file-transfer-linux

Android File Transfer for Linux (and macOS!)
http://whoozle.github.io/android-file-transfer-linux/
GNU Lesser General Public License v2.1
1.47k stars 120 forks source link

Owner of files downloaded from Android device on local machine #267

Open probonopd opened 3 years ago

probonopd commented 3 years ago

It seems like Android File Transfer for Linux requires to run as root to access the Android device (at least on FreeBSD). Running it as root seems to have the unintended side effect that files downloaded from the device to the desktop results in files on the desktop that are owned by root, and hence cannot be modified nor deleted by the normal user.

Is there a way around this, e.g., an environment variable that one could pass to Android File Transfer for Linux that would define the username which should be used when creating files on the local desktop machine?

whoozle commented 3 years ago

Are you running it using sudo? sudo provides SUDO_UID and SUDO_USER and it may help it. I can add it, but ideally I'd like to provide an instruction for FreeBSD users how to do it properly.

AFTL does not require any super user capabilities, it just needs access to the raw usb device files. Normally they may have some special group, e.g. usb, so you can add this group to your user group list. And if it does not, maybe we need to fix it in FreeBSD :wink: