termux / termux-packages

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

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

Open HusniMuhammad opened 6 days ago

HusniMuhammad commented 6 days 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 4 days 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 4 days 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 4 days ago

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

HusniMuhammad commented 3 days ago

Oh I forget to mention that ,

Here's the output of original issue

IMG_20241014_062446

landfillbaby commented 3 days ago

EFAULT? weird...

sylirre commented 2 days ago

Can't reproduce:

TermuxScreenshot

truboxl commented 2 days ago

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

sylirre commented 2 days ago

With /system/bin/mv works too.

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

truboxl commented 1 day ago

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

I also can't reproduce on arm either.

HusniMuhammad commented 1 day 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 day 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 day 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 day 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 day 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 day ago
/system/bin/mv /storage/emulated/0/folder\'s /storage/emulated/0/folder1\'s
HusniMuhammad commented 1 day ago

Same error

HusniMuhammad commented 1 day 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 day 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.