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

Commit 14dc6ad2 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "run-as: improve error messages."

parents 561df7bf 4a77a84a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -247,12 +247,12 @@ int main(int argc, char* argv[]) {

  std::string seinfo = std::string(info.seinfo) + ":fromRunAs";
  if (selinux_android_setcontext(uid, 0, seinfo.c_str(), pkgname) < 0) {
    error(1, errno, "couldn't set SELinux security context");
    error(1, errno, "couldn't set SELinux security context '%s'", seinfo.c_str());
  }

  // cd into the data directory, and set $HOME correspondingly.
  if (TEMP_FAILURE_RETRY(chdir(info.data_dir)) == -1) {
    error(1, errno, "couldn't chdir to package's data directory");
    error(1, errno, "couldn't chdir to package's data directory '%s'", info.data_dir);
  }
  setenv("HOME", info.data_dir, 1);