Sojurn
Sojurn

Reputation: 485

ADB getting a permission denied despite running as root

I have a rooted tablet that gives adb root as soon as it connects.

When I type adb shell I get root@android:/#

I can do su and it's not showing me any permissions errors

But when I try to execute a file on an sdcard that has already been given all permissions. I get Permission Denied

Why is this happening?

Upvotes: 5

Views: 7918

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40347

The sdcard is mounted with a noexec flag, which means you cannot execute things stored there.

This is doubly important when running as root or even the semi privileged shell, since the lack of file permissions or ownership there means any userid with the write external storage permission could trojanize the program you might want to run.

As an aside the default shell has a limited vocabulary of errors and in many versions will also say permission denied as a substitute for command not found. Your current working directory is not in the search path, so if you want to run something from there, you typically need to do:

./filename 

Upvotes: 8

Related Questions