2

I am trying to run an executable from the android terminal with root permissions, but I am constantly receiving the following error:

[ExecutableName] : permission denied

I am confirmed to be loged in as root. I see the # sign before my prompt and I can run root commands such as chmod. I saw that the android shell guide says

"The built-in shell has very limited error handling. When you type a command name >incorrectly it will say "permission denied", even though the real problem is that it >couldn't find the command:"

Does anyone know how to get more information on this "permission denied" error?

7
  • Can you run ls -l from the directory the executable is in and post that? Commented Dec 11, 2011 at 17:23
  • Here is what I ran, I just really want more info on what happens when i run it. ---xrwxr-x 1 system sdcard_r 76 Oct 3 2007 doukutsu Commented Dec 11, 2011 at 18:26
  • 2
    Hm, the sdcard_r is interesting. Is the binary on your SD card? I know some devices (but possibly not all) simply won't let you run an executable if it's on the external storage. You could try moving it to /data/local or somewhere similar and see if that helps. I don't know that there's a way to simply get more info from the shell as to why you're getting permission denied, though. Commented Dec 11, 2011 at 18:48
  • Do you have SuperUser installed? What does the log say? Commented Dec 11, 2011 at 19:08
  • @MatthewRead It says "terminal emulator allowed" Commented Dec 11, 2011 at 21:08

1 Answer 1

6

As eldarerathis already mentioned: On many (if not most) devices supporting an SD card, this card is mounted with the noexec option -- which means as the name suggests: "no exec from here", i.e. you cannot execute anything from the sdcard.

Again, one solution was already mentioned by eldarerathis: Try a different storage. You've got the power, your device is rooted.

A second approach would be to re-mount the sdcard without the noexec option. But there's a good reason why noexec is used here; it at least offers an additional level of security. So before using this approach, you should research a bit whether it might trigger unwanted side-effects.

1
  • +1 from me - that's the sole reason why SDcards have the executable bit blocked at the filesystem level, to prevent malicious apps wreaking havoc from another place outside of the ROM i.e. SDcard!
    – t0mm13b
    Commented Aug 7, 2012 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .