spion / adbfs-rootless

Mount Android phones on Linux with adb. No root required.
Other
908 stars 73 forks source link

Error if file name contains $ sign #57

Open tylla opened 2 years ago

tylla commented 2 years ago

If filename contains a $ sign like "I_20180602000000000_EO$20180602000000000.raw", only listing operations work, any editing, copying operations fail, because the part with the $ sign gets special treatment.

A debug output for an edit operation looks like this:

unique: 329, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 3833
LOOKUP /sdcard
getattr /sdcard
adb_getattr
--*-- exec_command: adb shell "ls -l -a -d '/sdcard'" 2>&1
   NODEID: 54
   unique: 329, success, outsize: 144
unique: 330, opcode: LOOKUP (1), nodeid: 54, insize: 48, pid: 3833
LOOKUP /sdcard/Android
getattr /sdcard/Android
adb_getattr
from cache /sdcard/Android
   NODEID: 74
   unique: 330, success, outsize: 144
unique: 331, opcode: LOOKUP (1), nodeid: 74, insize: 45, pid: 3833
LOOKUP /sdcard/Android/data
getattr /sdcard/Android/data
adb_getattr
from cache /sdcard/Android/data
   NODEID: 110
   unique: 331, success, outsize: 144
unique: 332, opcode: LOOKUP (1), nodeid: 110, insize: 68, pid: 3833
LOOKUP /sdcard/Android/data/com.hikvision.thermalGoogle
getattr /sdcard/Android/data/com.hikvision.thermalGoogle
adb_getattr
from cache /sdcard/Android/data/com.hikvision.thermalGoogle
   NODEID: 155
   unique: 332, success, outsize: 144
unique: 333, opcode: LOOKUP (1), nodeid: 155, insize: 46, pid: 3833
LOOKUP /sdcard/Android/data/com.hikvision.thermalGoogle/files
getattr /sdcard/Android/data/com.hikvision.thermalGoogle/files
adb_getattr
from cache /sdcard/Android/data/com.hikvision.thermalGoogle/files
   NODEID: 210
   unique: 333, success, outsize: 144
unique: 334, opcode: LOOKUP (1), nodeid: 210, insize: 48, pid: 3833
LOOKUP /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture
getattr /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture
adb_getattr
from cache /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture
   NODEID: 212
   unique: 334, success, outsize: 144
unique: 335, opcode: LOOKUP (1), nodeid: 212, insize: 51, pid: 3833
LOOKUP /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25
getattr /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25
adb_getattr
from cache /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25
   NODEID: 216
   unique: 335, success, outsize: 144
unique: 336, opcode: LOOKUP (1), nodeid: 216, insize: 87, pid: 3833
LOOKUP /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw
getattr /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw
adb_getattr
from cache /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw
   NODEID: 219
   unique: 336, success, outsize: 144
unique: 337, opcode: OPEN (14), nodeid: 219, insize: 48, pid: 22361
open flags: 0x8800 /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw
-- adb_open --/sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw /tmp/adbfs-d07kDv/-sdcard-Android-data-com.hikvision.thermalGoogle-files-capture-2022-02-25-I_20180602000000000_E_O_$20180602000000000.raw
ls -l -a -d '/sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw'
--*-- exec_command: adb shell "ls -l -a -d '/sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_$20180602000000000.raw'"
ls: /sdcard/Android/data/com.hikvision.thermalGoogle/files/capture/2022-02-25/I_20180602000000000_E_O_.raw: No such file or directory
Error: signal 11:
adbfs(+0x3b68)[0x55a110c15b68]
/lib/x86_64-linux-gnu/libc.so.6(+0x37840)[0x7f48b4a41840]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm+0x0)[0x7f48b4ea64c0]
adbfs(+0x5c79)[0x55a110c17c79]
adbfs(+0x7675)[0x55a110c19675]
/lib/x86_64-linux-gnu/libfuse.so.2(fuse_fs_open+0xe0)[0x7f48b4f19910]
/lib/x86_64-linux-gnu/libfuse.so.2(+0xda16)[0x7f48b4f19a16]
/lib/x86_64-linux-gnu/libfuse.so.2(+0x17dc4)[0x7f48b4f23dc4]
/lib/x86_64-linux-gnu/libfuse.so.2(+0x170b8)[0x7f48b4f230b8]
/lib/x86_64-linux-gnu/libfuse.so.2(+0x13d5c)[0x7f48b4f1fd5c]
--*-- exec_command: rm -rf /tmp/adbfs-d07kDv/