termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.39k stars 3.08k forks source link

[Bug]: mv not working with specific character #21768

Open HusniMuhammad opened 1 month ago

HusniMuhammad commented 1 month ago

Problem description

mv command with With ' character not working

IMG_20241014_062446

What steps will reproduce the bug?

cp "/storage/emulated/0/Download/podcast/CKP - Connor Kenway's" "/storage/emulated/0/Download/podcast/ee/CKP - Connor Kenway's"

What is the expected behavior?

move to specific directory

System information

`Termux Variables:
TERMUX_API_APP__VERSION_NAME=0.50.1
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~LkYORvIv7C6UCW4kjISZRQ==/com.termux-9Wz4ANftMUKJoKDOTRGxCA==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=7333
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c216,c257,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c216,c257,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10472
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+062c977
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+062c977
TERMUX__USER_ID=0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://packages.termux.dev/apt/termux-main stable main
# sources.list.d/termux-adb.list
deb https://nohajc.github.io termux extras
Updatable packages:
c-ares/stable 1.34.1 arm [upgradable from: 1.33.1]
curl/stable 8.10.1-1 arm [upgradable from: 8.10.1]
imagemagick/stable 7.1.1.39 arm [upgradable from: 7.1.1.38-1]
libcurl/stable 8.10.1-1 arm [upgradable from: 8.10.1]
termux-tools version:
1.43.6
Android version:
11
Kernel build information:
Linux localhost 4.14.193+-ab478 #1 SMP PREEMPT Thu May 9 16:42:40 CST 2024 armv8l Android
Device manufacturer:
realme
Device model:
RMX3231
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.widget versionCode:13`
landfillbaby commented 1 month ago
ls -d '/storage/emulated/0/Download/podcast/CKP - Connor Kenway'* | hexdump -C

if the output of that command has something like |r Kenway...s.| in it, this isn't a termux issue. the file just has a slightly different apostrophe character, instead of '. that trips a lot of people up

HusniMuhammad commented 1 month ago
ls -d '/storage/emulated/0/Download/podcast/CKP - Connor Kenway'* | hexdump -C

if the output of that command has something like |r Kenway...s.| in it, this isn't a termux issue. the file just has a slightly different apostrophe character, instead of '. that trips a lot of people up

IMG_20241013_211135

landfillbaby commented 1 month ago

i should have asked before, what's the actual output of the mv command you say isn't working?

HusniMuhammad commented 1 month ago

Oh I forget to mention that ,

Here's the output of original issue

IMG_20241014_062446

landfillbaby commented 1 month ago

EFAULT? weird...

sylirre commented 1 month ago

Can't reproduce:

TermuxScreenshot

truboxl commented 1 month ago

Can you try use /system/bin/mv instead of mv?

sylirre commented 1 month ago

With /system/bin/mv works too.

My devices are AArch64, so I guess issue may be still reproduced on ARM.

truboxl commented 1 month ago

Oops I meant to direct the question to the issue reporter.

I also can't reproduce on arm either.

HusniMuhammad commented 1 month ago

Can you try use /system/bin/mv instead of mv?

No, but file managers also throw this error Screenshot_20241011-141053

sylirre commented 1 month ago

Can be related to file system corruption.

Try to create a different file with similar name and move/copy it. Also try rebooting device and move original file after.

HusniMuhammad commented 1 month ago

IMG_20241016_171437

Step-1

mkdir /storage/emulated/0/folder\'s

Step-2

mv /storage/emulated/0/folder\'s /storage/emulated/0/folder1\'s

Note: Copying, deletion are working fine, but moving & renaming not working

sylirre commented 1 month ago

You may try /system/bin/mv, but I think it will fail too. As file manager in one of comments above shown similar failure, it is most likely a bug of Android OS.

That's not a first issue related to file system layer on /storage/emulated/0.

HusniMuhammad commented 1 month ago

You may try /system/bin/mv, but I think it will fail too. As file manager in one of comments above shown similar failure, it is most likely a bug of Android OS.

That's not a first issue related to file system layer on /storage/emulated/0.

How to do that

sylirre commented 1 month ago
/system/bin/mv /storage/emulated/0/folder\'s /storage/emulated/0/folder1\'s
HusniMuhammad commented 1 month ago

Same error

HusniMuhammad commented 1 month ago

But in Samsung M12 worked IMG_20241016_185453

Android version: 13 Kernel build information: Linux localhost 4.19.111-27127798 #1 SMP PREEMPT Tue M ay 14 18:19:35 KST 2024 aarch64 Android Device manufacturer: samsung Device model: SM-M127F

sylirre commented 1 month ago

It also works on all my devices.

Problem is specific to realme RMX3231 or Android version (11). This is why issue considered as system bug.

truboxl commented 1 month ago

Can you post the output of mount and stat -f -c%T /storage/emulated/0? I doubt we can fix anything but for documentation purpose.

HusniMuhammad commented 1 month ago

fuseblk

stat -f -c%T /storage/emulated/0

mount

/dev/block/dm-5 on / type ext4 (ro,nodev,relatime,seclabel) tmpfs on /dev type tmpfs (rw,nosuid,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755) devpts on /dev/pts type devpts (rw,relatime,seclabel,mode=600,ptmxmode=000) none on /dev/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) none on /dev/cg2_bpf type cgroup2 (rw,nosuid,nodev,noexec,relatime) none on /dev/cpuctl type cgroup (rw,nosuid,nodev,noexec,relatime,cpu) none on /dev/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent) none on /dev/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) none on /dev/memcg type cgroup (rw,nosuid,nodev,noexec,relatime,memory) none on /dev/stune type cgroup (rw,nosuid,nodev,noexec,relatime,schedtune) binder on /dev/binderfs type binder (rw,relatime,max=1048576,stats=global) adb on /dev/usb-ffs/adb type functionfs (rw,relatime) proc on /proc type proc (rw,relatime,gid=3009,hidepid=2) sysfs on /sys type sysfs (rw,relatime,seclabel) selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) tracefs on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) none on /sys/fs/fuse/connections type fusectl (rw,relatime) bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) tmpfs on /mnt type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755,gid=1000) tmpfs on /mnt/installer type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755,gid=1000) /dev/fuse on /mnt/installer/0/emulated type fuse (rw,nosuid,nodev,noexec,noatime,lazytime,user_id=0,group_id=0,allow_other) /dev/block/dm-11 on /mnt/installer/0/emulated/0/Android/data type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /mnt/installer/0/emulated/0/Android/obb type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) tmpfs on /mnt/androidwritable type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755,gid=1000) /dev/fuse on /mnt/androidwritable/0/emulated type fuse (rw,nosuid,nodev,noexec,noatime,lazytime,user_id=0,group_id=0,allow_other) /dev/block/dm-11 on /mnt/androidwritable/0/emulated/0/Android/data type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /mnt/androidwritable/0/emulated/0/Android/obb type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/by-name/prodnv on /mnt/vendor type ext4 (rw,nosuid,nodev,noatime,seclabel,noauto_da_alloc,data=ordered) /dev/block/dm-9 on /mnt/vendor/socko type ext4 (ro,nosuid,nodev,noatime,seclabel,noauto_da_alloc) /dev/block/dm-10 on /mnt/vendor/odmko type ext4 (ro,nosuid,nodev,noatime,seclabel,noauto_da_alloc) /dev/fuse on /mnt/user/0/emulated type fuse (rw,nosuid,nodev,noexec,noatime,lazytime,user_id=0,group_id=0,allow_other) /dev/block/dm-11 on /mnt/user/0/emulated/0/Android/data type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /mnt/user/0/emulated/0/Android/obb type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /mnt/pass_through/0/emulated type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/by-name/metadata on /metadata type ext4 (rw,nosuid,nodev,noatime,seclabel,errors=panic,data=ordered) /dev/block/dm-6 on /system_ext type ext4 (ro,relatime,seclabel) /dev/block/dm-7 on /vendor type ext4 (ro,relatime,seclabel) /dev/block/dm-8 on /product type ext4 (ro,relatime,seclabel) tmpfs on /apex type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755) /dev/block/dm-5 on /apex/com.android.adbd type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.tzdata type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.mediaprovider type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.vndk.v30 type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.tethering type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.i18n type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.sdkext type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.ipsec type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.os.statsd type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.neuralnetworks type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.conscrypt type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.media type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.extservices type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.media.swcodec type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.runtime type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.wifi type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.art type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.resolv type ext4 (ro,relatime,seclabel) /dev/block/dm-5 on /apex/com.android.permission type ext4 (ro,relatime,seclabel) tmpfs on /linkerconfig type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755) tmpfs on /linkerconfig type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755) none on /acct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct) none on /config type configfs (rw,nosuid,nodev,noexec,relatime) /dev/block/by-name/cache on /cache type ext4 (rw,nosuid,nodev,noatime,seclabel,noauto_da_alloc,data=ordered) /dev/block/dm-11 on /data type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /data/user/0 type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) tmpfs on /data_mirror type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=700,gid=1000) /dev/block/dm-11 on /data_mirror/data_ce/null type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /data_mirror/data_ce/null/0 type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /data_mirror/data_de/null type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /data_mirror/cur_profiles type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) tmpfs on /storage type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=953020k,nr_inodes=238255,mode=755,gid=1000) /dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,lazytime,user_id=0,group_id=0,allow_other) /dev/block/dm-11 on /storage/emulated/0/Android/data type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier) /dev/block/dm-11 on /storage/emulated/0/Android/obb type f2fs (rw,nosuid,nodev,noatime,lazytime,seclabel,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier)