Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 478
Sojurn Avatar asked Jul 10 '12 14:07

Sojurn


1 Answers

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 
like image 61
Chris Stratton Avatar answered Sep 18 '22 14:09

Chris Stratton