Merge "Fix run-as for non-owner users"
This commit is contained in:
commit
a123155f3e
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue