platform_system_core/run-as
Alex Klyubin b0739c662d Fix run-as which was broken in Android 4.3
In Android 4.3 the run-as binary no longer has the SUID/SGID bits
set. Instead, it requires to be installed with setuid and setgid
file-based capabilities. As a result of the above two changes, the
binary no longer executes as root when invoked by the "shell" user
but can still change its UID/GID to that of the target package.

Unfortunately, run-as attempts to chdir into the target package's
data directory before changing its effective UID/GID. As a result,
when run-as is invoked by the "shell" user, the chdir operation
fails.

The fix is for run-as to chdir after changing the effective UID/GID
to those of the target package.

Bug: 10154652

(cherry picked from commit f2904a7b63)

Change-Id: I0f6cb9efd49f5c2c491f7aa1d614d700a5ec2304
2013-08-21 12:15:27 -07:00
..
Android.mk run-as: set the SELinux security context. 2012-11-13 12:56:48 -05:00
NOTICE Add 'run-as' command implementation as set-uid program. 2010-03-17 11:02:08 -07:00
package.c am f19e045c: am c8df252f: Merge "run-as: Get seinfo from packages.list and pass to libselinux." 2013-03-28 14:32:49 -07:00
package.h run-as: Get seinfo from packages.list and pass to libselinux. 2013-03-28 06:04:39 -04:00
run-as.c Fix run-as which was broken in Android 4.3 2013-08-21 12:15:27 -07:00