Skip to content

Commit 515087d

Browse files
committed
Explicitly set lib dir permissions during unlink
The default umask changed, so we have to explicitly set the mode of the lib directory when we create it in unlinklib. Bug: 6857022 Change-Id: I06fc3f29e99d686bbbb96184d8c314d4cc57e9fe
1 parent 47db02b commit 515087d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmds/installd/commands.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,12 @@ int unlinklib(const char* dataDir)
10561056
rc = -errno;
10571057
goto out;
10581058
}
1059-
1059+
if (chmod(libdir, 0755) < 0) {
1060+
ALOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno));
1061+
unlink(libdir);
1062+
rc = -errno;
1063+
goto out;
1064+
}
10601065
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
10611066
ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
10621067
unlink(libdir);

0 commit comments

Comments
 (0)