Revert "run-as: allow running cmds for apps profileable from shell."

This reverts commit 6192687591.

Reason for revert: needs security review.

Bug: 118835348
Change-Id: I89dc98ac5464960430abd318c47e30788fee1565
This commit is contained in:
Yabin Cui 2018-11-12 23:41:31 +00:00
parent 6192687591
commit a01f8ed295
3 changed files with 4 additions and 23 deletions

View file

@ -53,7 +53,6 @@ struct pkg_info {
char *seinfo;
gid_list gids;
void *private_data;
bool profileable_from_shell;
};
/**

View file

@ -223,23 +223,6 @@ extern bool packagelist_parse(pfn_on_package callback, void *userdata)
}
}
cur = strsep(&next, " \t\r\n");
if (cur) {
tmp = strtoul(cur, &endptr, 10);
if (*endptr != '\0') {
errmsg = "Could not convert field \"profileable_from_shell\" to integer value";
goto err;
}
/* should be a valid boolean of 1 or 0 */
if (!(tmp == 0 || tmp == 1)) {
errmsg = "Field \"profileable_from_shell\" is not 0 or 1 boolean value";
goto err;
}
pkg_info->profileable_from_shell = (bool)tmp;
}
rc = callback(pkg_info, userdata);
if (rc == false) {
/*

View file

@ -45,7 +45,7 @@
//
// - that the ro.boot.disable_runas property is not set
// - that it is invoked from the 'shell' or 'root' user (abort otherwise)
// - that '<package-name>' is the name of an installed and debuggable/profileableFromShell package
// - that '<package-name>' is the name of an installed and debuggable package
// - that the package's data directory is well-formed
//
// If so, it will drop to the application's user id / group id, cd to the
@ -57,7 +57,6 @@
// during development.
//
// - Run the 'gdbserver' binary executable to allow native debugging
// - Run simpleperf to allow native profiling
//
static bool packagelist_parse_callback(pkg_info* this_package, void* userdata) {
@ -197,9 +196,9 @@ int main(int argc, char* argv[]) {
error(1, 0, "package not an application: %s", pkgname);
}
// Reject packages that are neither debuggable nor profileable from shell.
if (!info.debuggable && !info.profileable_from_shell) {
error(1, 0, "package is neither debuggable nor profileable from shell: %s", pkgname);
// Reject any non-debuggable package.
if (!info.debuggable) {
error(1, 0, "package not debuggable: %s", pkgname);
}
// Check that the data directory path is valid.