0

I'm running SuperSu 2.82 (latest) and Termux (latest) on Andriod 7.

What is causing the permission denied error below? I get the same error with mount namespace separation turned off (or on) in SuperSU.

Welcome to Termux!

Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on libera.chat

Working with packages:

 * Search packages:   pkg search <query>
 * Install a package: pkg install <package>
 * Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

 * Root:     pkg install root-repo
 * Unstable: pkg install unstable-repo
 * X11:      pkg install x11-repo

Report issues at https://termux.com/issues

~ $ echo $0
/data/data/com.termux/files/usr/bin/bash
~ $ id -u
10212
~ $ echo $HOME
/data/data/com.termux/files/home
~ $ echo $PATH
/data/data/com.termux/files/usr/bin

~ $ ls -la /data/data/com.termux/files/usr/bin/readlink
lrwxrwxrwx 1 u0_a212 u0_a212 9 Oct 21 04:05 /data/data/com.termux/files/usr/bin/readlink -> coreutils

~ $ ls -la /data/data/com.termux/files/usr/bin/coreutils
-rwx------ 1 u0_a212 u0_a212 1032096 Jul 30 11:15 /data/data/com.termux/files/usr/bin/coreutils

~ $ exec su --mount-master -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH HOME=$HOME PATH=$PATH:$HOME/bin $0"

~ # [ $(readlink /proc/1/ns/mnt) = $(readlink /proc/self/ns/mnt) ] || nsenter -t 1 -m -- "$0"
bash: /data/data/com.termux/files/usr/bin/readlink: Permission denied
bash: /data/data/com.termux/files/usr/bin/readlink: Permission denied

The error is not limited to readlink. It applies to all the core commands I tried, including ls:

~ # ls
bash: /data/data/com.termux/files/usr/bin/ls: Permission denied

I get better results with tsu, but then I get a new 'permission denied' error at my next step after readlink:

rclone -v mount mypcloud: /mnt/runtime/write/emulated/0/mypcloud --gid 9997 --dir-perms 0771 --file-perms 0660 --umask=0 --allow-other

2021/10/23 03:30:12 Fatal error: failed to mount FUSE fs: fusermount: fork/exec /system/bin/fusermount: permission denied

It doesn't matter which mountpoint I use. Also, the above permission error is not related to any of the options --gid 9997 --dir-perms 0771 --file-perms 0660 --umask=0:

# mkdir -p /mnt/cloud/mypcloud
# chmod 775 -R /mnt/cloud/
# rclone -v mount mypcloud: /mnt/cloud/mypcloud --allow-other
WARNING: linker: /data/data/com.termux/files/usr/bin/rclone: unsupported flags DT_FLAGS_1=0x8000001
2021/10/23 03:51:33 INFO  : pcloud root '': poll-interval is not supported by this remote
2021/10/23 03:51:33 NOTICE: pcloud root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2021/10/23 03:51:33 Fatal error: failed to mount FUSE fs: fusermount: fork/exec /system/bin/fusermount: permission denied
1

0

You must log in to answer this question.

Browse other questions tagged .