summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Cherry2018-03-28 15:25:11 -0500
committerTom Cherry2018-03-29 16:10:12 -0500
commitb5e5c56401143122fed5687997b499eae66b841e (patch)
tree6aebf557127013adac49058de68630aca1ef2d25 /libcutils/fs_config.cpp
parent61896fc0ee671311b98732c197dbcf5c8a435387 (diff)
downloadplatform-system-core-b5e5c56401143122fed5687997b499eae66b841e.tar.gz
platform-system-core-b5e5c56401143122fed5687997b499eae66b841e.tar.xz
platform-system-core-b5e5c56401143122fed5687997b499eae66b841e.zip
Remove vendor Wifi and BT entries from fs_config.cpp
Their capability bits are now specified in their associated init .rc file, which is the proper place for this to be done. A notice is added to guide developers away from using android_files to give services Linux capabilities and to guide them away from adding vendor/ entries. Bug: 74554159 Test: BT, Wifi, Tethering work on walleye Change-Id: I13c425d022b4f5c217587cdf601884ef44650ac7
Diffstat (limited to 'libcutils/fs_config.cpp')
-rw-r--r--libcutils/fs_config.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index f6f7128b0..0f2b46075 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -122,6 +122,12 @@ static const char* conf[][2] = {
122 {odm_conf_file, odm_conf_dir}, 122 {odm_conf_file, odm_conf_dir},
123}; 123};
124 124
125// Do not use android_files to grant Linux capabilities. Use ambient capabilities in their
126// associated init.rc file instead. See https://source.android.com/devices/tech/config/ambient.
127
128// Do not place any new vendor/, data/vendor/, etc entries in android_files.
129// Vendor entries should be done via a vendor or device specific config.fs.
130// See https://source.android.com/devices/tech/config/filesystem#using-file-system-capabilities
125static const struct fs_path_config android_files[] = { 131static const struct fs_path_config android_files[] = {
126 // clang-format off 132 // clang-format off
127 { 00644, AID_SYSTEM, AID_SYSTEM, 0, "data/app/*" }, 133 { 00644, AID_SYSTEM, AID_SYSTEM, 0, "data/app/*" },
@@ -185,24 +191,6 @@ static const struct fs_path_config android_files[] = {
185 // Support FIFO scheduling mode in SurfaceFlinger. 191 // Support FIFO scheduling mode in SurfaceFlinger.
186 { 00755, AID_SYSTEM, AID_GRAPHICS, CAP_MASK_LONG(CAP_SYS_NICE), 192 { 00755, AID_SYSTEM, AID_GRAPHICS, CAP_MASK_LONG(CAP_SYS_NICE),
187 "system/bin/surfaceflinger" }, 193 "system/bin/surfaceflinger" },
188
189 // Support hostapd administering a network interface.
190 { 00755, AID_WIFI, AID_WIFI, CAP_MASK_LONG(CAP_NET_ADMIN) |
191 CAP_MASK_LONG(CAP_NET_RAW),
192 "vendor/bin/hostapd" },
193
194 // Support Bluetooth legacy hal accessing /sys/class/rfkill
195 // Support RT scheduling in Bluetooth
196 { 00700, AID_BLUETOOTH, AID_BLUETOOTH, CAP_MASK_LONG(CAP_NET_ADMIN) |
197 CAP_MASK_LONG(CAP_SYS_NICE),
198 "vendor/bin/hw/android.hardware.bluetooth@1.0-service" },
199
200 // Support wifi_hal_legacy administering a network interface.
201 { 00755, AID_WIFI, AID_WIFI, CAP_MASK_LONG(CAP_NET_ADMIN) |
202 CAP_MASK_LONG(CAP_NET_RAW) |
203 CAP_MASK_LONG(CAP_SYS_MODULE),
204 "vendor/bin/hw/android.hardware.wifi@1.0-service" },
205
206 // generic defaults 194 // generic defaults
207 { 00755, AID_ROOT, AID_ROOT, 0, "bin/*" }, 195 { 00755, AID_ROOT, AID_ROOT, 0, "bin/*" },
208 { 00640, AID_ROOT, AID_SHELL, 0, "fstab.*" }, 196 { 00640, AID_ROOT, AID_SHELL, 0, "fstab.*" },