Fix permissions on cloned data dirs
This makes the downloaded apk visible to the package installer
Change-Id: I0f60cf279a3c6a08c7479f93ef9135d7428f2385
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index c16e6fb..a52f74a 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -194,6 +194,11 @@
ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
return -errno;
}
+ if (chmod(pkgdir, 0751) < 0) {
+ ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
+ unlink(pkgdir);
+ return -errno;
+ }
if (chown(pkgdir, uid, uid) < 0) {
ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);