Jump to content

Welcome to CyanogenMod

Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Get your own profile and make new friends
  • Download files attached to the forum.
  • Customize your experience here
  • Share your CyanogenMod experience!
Guest Message by DevFuse

run-as not working due to /data/data symlink

  • Please log in to reply
No replies to this topic

#1 reciprocal

  • Members
  • 1 posts
  • Device Model:
  • CM Version:
    7.1 RC 1
  • Recovery Image:

Posted 12 July 2011 - 05:15 PM


I'd like to report a bug with Cyanogen 7.1 RC1, which makes the "run-as" command unusable.

"run-as" can be used to run commands with the permissions of an installed package, and is e.g. required
when debugging with ndk-gdb (i.e., "run-as" is essential for development).

On CyanogenMod, "adb shell run-as org.example.app" fails with the message "run-as: Package 'org.example.app' has corrupt installation".

The reason "run-as" does not work on cyanogen mod is the fact that "run-as"
does have strict requirements about the permissions of the application data directory:

it checks  whether the application data directory (and all subdirectories leading up to it)
is owned by the system user and system group, and whether it is a real directory. However, /data/data
is a symlink in cyanogen, which makes "run-as" fail.

I've worked around it by removing the symlink and moving the contents of /datadata into /data/data,
but wanted to make you aware of this issue so this can hopefully be fixed properly.