Skip to content

Commit e583bcf

Browse files
krutonAndroid (Google) Code Review
authored andcommitted
Merge "Explicitly set lib dir permissions during unlink" into jb-dev
2 parents 1af5ac1 + 515087d commit e583bcf

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)