OSDN Git Service

Make /linkerconfig/<apexname> directories accessible to others
authorJiyong Park <jiyong@google.com>
Fri, 21 Feb 2020 04:56:52 +0000 (13:56 +0900)
committerJiyong Park <jiyong@google.com>
Fri, 21 Feb 2020 04:56:52 +0000 (13:56 +0900)
commitd60182013c4b6574a6f3f86e4fdfaeaf4e1f0dc9
tree84aaa24a889b4dfc26033f5cce12c7f900228622
parent91fccce607c57199687618e9f24190eb79ebec79
Make /linkerconfig/<apexname> directories accessible to others

When linkerconfig is exec'ed by init, umask is by default set to 0x0077.
As a result, even though we create the directories with mkdir(...,
0755), they are marked as inaccessible for group and others.

Fixing the issue by explicitly setting umask to 0x0022.

Bug: 144914078
Test: build a device with flattened APEX. Check the mode bits of the
directories of under /linkerconfig.

$ ls -al /linkerconfig
total 96
drwxr-xr-x  9 root root   200 2020-02-21 13:47 .
drwxr-xr-x 22 root root  4096 2020-02-21 13:54 ..
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.adbd
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.art
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.conscrypt
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.media.swcodec
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.os.statsd
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.runtime
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.sdkext
-rw-r--r--  1 root root 91651 2020-02-21 13:47 ld.config.txt

Change-Id: Id2f7f8a363ba239943942ba6e3bc984cd8f630b0
main.cc