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

Commit a123155f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix run-as for non-owner users"

parents e0c3a8d9 0c5411c7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -167,6 +167,15 @@ int main(int argc, char* argv[]) {
  if (!packagelist_parse(packagelist_parse_callback, &info)) {
    error(1, errno, "packagelist_parse failed");
  }

  // 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);
  }