summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2012-03-23 17:52:33 -0700
committerNick Kralevich <nnk@google.com>2012-03-23 18:00:47 -0700
commit7ac3ed1d7679e9cb90b44c6ab1629318b17c0690 (patch)
treed90a4d55b2537500d16a3c6e60ec6e7681e65a85 /cmds
parentcbe55a1c93056cf2878007ebf823a0ac2ad168b1 (diff)
downloadframeworks_base-7ac3ed1d7679e9cb90b44c6ab1629318b17c0690.zip
frameworks_base-7ac3ed1d7679e9cb90b44c6ab1629318b17c0690.tar.gz
frameworks_base-7ac3ed1d7679e9cb90b44c6ab1629318b17c0690.tar.bz2
resist umask changes, make dirs 0711
Make sure /data/user directory permissions get explicitly set regardless of the system umask. Change directory permissions to 0711. No need for read permissions. Bug: 3272072 Change-Id: Ida7f3c6656f4e0c9d0a9f7648491cc853c4e44ca
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/installd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 7f94a96..c2c749a 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -332,12 +332,15 @@ int initialize_directories() {
ret = 0;
// Make the /data/user directory if necessary
if (access(user_data_dir, R_OK) < 0) {
- if (mkdir(user_data_dir, 0755) < 0) {
+ if (mkdir(user_data_dir, 0711) < 0) {
return -1;
}
if (chown(user_data_dir, AID_SYSTEM, AID_SYSTEM) < 0) {
return -1;
}
+ if (chmod(user_data_dir, 0711) < 0) {
+ return -1;
+ }
}
// Make the /data/user/0 symlink to /data/data if necessary
if (access(primary_data_dir, R_OK) < 0) {