summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-04-09 19:46:14 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-09 19:46:14 +0000
commit236ed6d3d376b12573cca6878d3b5013371f5bc8 (patch)
tree170c31c529e0049205e533179467948c963b9431
parent4215f434187d518bf8c9807c9a18a7e0b617f7d2 (diff)
parent82fb58095524c833b0470c4b236aa8a70acf2a0f (diff)
downloadframeworks_native-236ed6d3d376b12573cca6878d3b5013371f5bc8.zip
frameworks_native-236ed6d3d376b12573cca6878d3b5013371f5bc8.tar.gz
frameworks_native-236ed6d3d376b12573cca6878d3b5013371f5bc8.tar.bz2
am 82fb5809: Merge "restorecon the profile directory."
* commit '82fb58095524c833b0470c4b236aa8a70acf2a0f': restorecon the profile directory.
-rw-r--r--cmds/installd/utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c
index 8f4da65..671d031 100644
--- a/cmds/installd/utils.c
+++ b/cmds/installd/utils.c
@@ -1022,7 +1022,13 @@ int create_profile_file(const char *pkgname, gid_t gid) {
// Make the profile directory write-only for group and other. Owner can rwx it.
if (chmod(profile_dir, 0711) < 0) {
ALOGE("cannot chown profile dir '%s': %s\n", profile_dir, strerror(errno));
- unlink(profile_dir);
+ rmdir(profile_dir);
+ return -1;
+ }
+
+ if (selinux_android_restorecon(profile_dir, 0) < 0) {
+ ALOGE("cannot restorecon profile dir '%s': %s\n", profile_dir, strerror(errno));
+ rmdir(profile_dir);
return -1;
}
}