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

Commit f913add7 authored by Elliott Hughes's avatar Elliott Hughes Committed by Automerger Merge Worker
Browse files

Merge "run-as: remove a special case." into main am: dbb4a111

parents 171c9404 dbb4a111
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -196,14 +196,6 @@ int main(int argc, char* argv[]) {
  }
  if (setegid(old_egid) == -1) error(1, errno, "couldn't restore egid");

  // Handle a multi-user data path
  if (userId > 0) {
    free(info.data_dir);
    if (asprintf(&info.data_dir, "/data/user/%d/%s", userId, pkgname) == -1) {
      error(1, errno, "asprintf failed");
    }
  }

  if (info.uid == 0) {
    error(1, 0, "unknown package: %s", pkgname);
  }
@@ -226,6 +218,12 @@ int main(int argc, char* argv[]) {
    error(1, 0, "package not debuggable: %s", pkgname);
  }

  // Ensure we have the right data path for the specific user.
  free(info.data_dir);
  if (asprintf(&info.data_dir, "/data/user/%d/%s", userId, pkgname) == -1) {
    error(1, errno, "asprintf failed");
  }

  // Check that the data directory path is valid.
  check_data_path(pkgname, info.data_dir, userAppId);