Skip to content

Magisk Alpha su doesn't support -c option #9

@CECoffee

Description

@CECoffee

Environment

  • Magisk version: b1dc47a0-alpha (29001)
  • termux-sudo version: 1.2.0

Details

When I execute sudo xxx, it always throws out the following error:

~ $ sudo nmap -O 1.1.1.1
No 'su' binary found that supports the '-c', '--shell', '--preserve-environment' and '--mount-master' options
SU_SEARCH_PATHS: /system/bin/su /debug_ramdisk/su /system/xbin/su /sbin/su /sbin/bin/su /system/sbin/su /su/xbin/su /su/bin/su /magisk/.core/bin/su
sudo requires a 'su' binary that supports the '-c', '--shell', '--preserve-environment' and '--mount-master' options

Further, I executed sudo -vv su:

~ $ sudo -vv su

Running sudo

Running sudo_set_su_variables
A su binary found at '/debug_ramdisk/su'
The su binary found does not support '-c' option, continuing search
No 'su' binary found that supports the '-c', '--shell', '--preserve-environment' and '--mount-master' options
SU_SEARCH_PATHS: /system/bin/su /debug_ramdisk/su /system/xbin/su /sbin/su /sbin/bin/su /system/sbin/su /su/xbin/su /su/bin/su /magisk/.core/bin/su
sudo requires a 'su' binary that supports the '-c', '--shell', '--preserve-environment' and '--mount-master' options

Obviously, magisk su mounted at /debug_ramdisk/su is correctly recognized.
sudo says it doesn't receive necessary params like '-c', but it's actually fine if I directly run /debug_ramdisk/su -c 'ls -a' in MT terminal:

#/ /debug_ramdisk/su -c 'ls -a'
.                          mi_ext
..                         mnt
acct                       odm
apex                       odm_dlkm
bin                        oem
bootstrap-apex             opconfig
bugreports                 opcust
cache                      postinstall
config                     proc
cust                       product
d                          sdcard
data                       second_stage_resources
data_mirror                storage
debug_ramdisk              sys
dev                        system
etc                        system_dlkm
init                       system_ext
init.environ.rc            tmp
init.recovery.hardware.rc  vendor
linkerconfig               vendor_dlkm
metadata

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions