Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2335bf2b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 4b859e41 a01f8ed2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ struct pkg_info {
    char *seinfo;
    gid_list gids;
    void *private_data;
    bool profileable_from_shell;
};

/**
+0 −17
Original line number Diff line number Diff line
@@ -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) {
            /*
+4 −5
Original line number Diff line number Diff line
@@ -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.