Skip to content

Commit 794d62f

Browse files
author
Amith Yamasani
committed
Fix permissions on cloned data dirs
This makes the downloaded apk visible to the package installer Change-Id: I0f60cf279a3c6a08c7479f93ef9135d7428f2385
1 parent 2c1dfa2 commit 794d62f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmds/installd/commands.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona)
194194
ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
195195
return -errno;
196196
}
197+
if (chmod(pkgdir, 0751) < 0) {
198+
ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
199+
unlink(pkgdir);
200+
return -errno;
201+
}
197202
if (chown(pkgdir, uid, uid) < 0) {
198203
ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
199204
unlink(pkgdir);

0 commit comments

Comments
 (0)