Commit graph

847 commits

Author SHA1 Message Date
Steven Moreland
d0a19a6487 Bluetooth hal: moved to vendor partition.
Bug: 35328775
Test: works in both binderized and passthrough modes
Change-Id: I61f1ff6b777089d7aad5184c0aee4f653897b32e
2017-02-27 15:41:48 -08:00
Alex Klyubin
b914f3f835 Merge "Make secilc accessible by root only" am: e803818832 am: 94259da99f
am: 97c93b48ab

Change-Id: I4cb11522ed51aa08afb3e49976ab765641a1a613
2017-02-27 23:27:58 +00:00
Alex Klyubin
3380927e71 Make secilc accessible by root only
There's no reason for SELinux policy compiler to be accessible by
anybode other than root.

Test: Device boots -- secilc isn't used yet anyway
Bug: 31363362
Change-Id: I26cf34f1412b8dd471f79271c491b473617a6df6
2017-02-27 13:27:58 -08:00
Jin Qian
135f161bae libcutils: remove storaged caps
Test: adb shell dumpsys storaged --force
Bug: 35323867
Change-Id: Ia58e5aa24885dcf56f8c4bec9dc15d0f3b4c3f4f
2017-02-27 12:54:32 -08:00
Greg Hackmann
a930af8921 libcutils: build tests with -Wall -Wextra -Werror
Test: mmm system/core/libcutils/tests

Change-Id: Iede18a008df5834b8ecedd6019c4444150748f68
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:38 -08:00
Greg Hackmann
7c60ec3029 libcutils: fix socket type in SocketsTest.TestGetLocalPort
With -Wall enabled locally, clang points out that the second parameter
to socket_inaddr_any_server() was accidentally hard-coded:

system/core/libcutils/tests/sockets_test.cpp:103:18: warning: unused variable 'type' [-Wunused-variable]
        for (int type : {SOCK_DGRAM, SOCK_STREAM}) {
                 ^

Bug: 26936282
Test: mmm system/core/libcutils/tests
Test: adb shell /data/nativetest/libcutils_test/libcutils_test32 \
	--gtest_filter=SocketsTest.TestGetLocalPort (on hikey)
Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64 \
        --gtest_filter=SocketsTest.TestGetLocalPort (on hikey)

Change-Id: Ib0fa24fb02a5ee14db0afd6591a62089e43bbec0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:38 -08:00
Greg Hackmann
6d90fdc5e5 libcutils: fix Wsign-compare warnings in multiuser_test
gid_t and uid_t are unsigned ints, so we need to compare against unsigned
constants.

Bug: 26936282
Test: mmm system/core/libcutils/tests
Test: adb shell /data/nativetest/libcutils_test/libcutils_test32 \
	--gtest_filter=MultiuserTest.* (on hikey)
Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64 \
	--gtest_filter=MultiuserTest.* (on hikey)

Change-Id: Ic4c8a137e3f37cb5e95ba925814f201cfd5a06b0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:34 -08:00
Isaac Chen
c44e3b56f3 Merge "Removed cpusets/schedboost build time dependency." am: d3f8d28db2 am: e60efc1b0b
am: a0e845a1b6

Change-Id: I276229340aa8bba013016c6079c28b1a9da8ed62
2017-02-21 18:10:40 +00:00
Isaac Chen
795267d4c7 Removed cpusets/schedboost build time dependency.
These two Soong product_variables were usually controlled by
ENABLE_CPUSETS and ENABLE_SCHEDBOOST in BoardConfig.mk. This change
turns the build time variables into runtime decision by checking if
a special file, "tasks", can be found under the mount points,
/dev/cpuset and /dev/stune, for cpusets and schedboost, respectively.

That special file only exists when the corresponding Linux kernel
configurations, CONFIG_CPUSETS and CONFIG_SCHEDTUNE, are set.

Bug: 34726944

Test: Tested on Sailfish with following configurations
          neither cpuset nor schedtune enabled in the kernel
          cpuset enabled, but schedtune disabled in the kernel
          both cpuset and schedtune enabled in the kernel

Change-Id: I6695b8b32b2fecb4fd995018418bbe2edc5d590f
2017-02-20 20:53:24 +08:00
Elliott Hughes
4cfa8399d1 Merge "Implement android::base::WaitForProperty." am: 01003d40fc am: d96f68ee21 am: 1f6d1c43b3
am: eecb127a22

Change-Id: I279f9b7bc374dd421936656a6fb2bc37658f6db6
2017-02-14 04:01:04 +00:00
Treehugger Robot
01003d40fc Merge "Implement android::base::WaitForProperty." 2017-02-14 03:48:26 +00:00
Steven Moreland
ba2e677615 Merge "fs_config: wifi is now on vendor partition" am: 11d3d4d22a am: c405ad5c43 am: 0d94c26fc9
am: 141b829e72

Change-Id: Ibd47a0775ca2c27579f4ff98ae2e8c5a55fcb5e8
2017-02-14 03:14:18 +00:00
Steven Moreland
b7ca92349e fs_config: wifi is now on vendor partition
Bug: 34135607
Test: pass
Change-Id: I0c9dd9642e780a0303e6aaa6d80e443c59cc0c28
2017-02-13 17:21:17 -08:00
Elliott Hughes
b30769a87a Implement android::base::WaitForProperty.
Also adapt libcutils to the bionic change that was necessary for this.

Bug: http://b/35201172
Test: ran tests
Change-Id: I72a98b70b03d23e958b46778b505fbd5c86c32ae
2017-02-13 11:29:02 -08:00
George Burgess IV
28c05881a2 Merge "cutils: Add clang FORTIFY support" am: f2e615c7b8 am: 9a7f57b909 am: f5a0eeb860
am: 272097bc85

Change-Id: I2f1820b030a4a2626744871748cb0be0b7da97c5
2017-02-10 02:18:19 +00:00
George Burgess IV
67959bceb2
cutils: Add clang FORTIFY support
Bug: 32073964
Test: Builds on angler, bullhead, marlin, sailfish. Bionic CTS tests
pass on Angler and Bullhead.

Change-Id: I3d7f8ff73f92b1deb1e07f08282098e71e2d03a9
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-02-09 20:18:19 +01:00
Todd Poynor
ebda1f9559 android_reboot: move reboot reason file to data/misc/reboot/
Move last reboot reason file to new directory data/misc/reboot/ to
require only SELinux permissions specific to this new file.

Bug: 30994946
Test: manual: reboot command, setprop sys.powerctl
Change-Id: I1e067235aa4b06391cff8ab0741a9d317ba5b7da
2017-02-06 15:48:22 -08:00
Josh Gao
0633e1ce75 Revert "Give crash_dump CAP_SYS_PTRACE." am: ac91b0c452 am: c49f8f3e3d am: 3d1ca37b0d
am: f11accb25b

Change-Id: Ifc56a652f63419e72274c725d401f67b6fd86320
2017-02-06 19:07:46 +00:00
Todd Poynor
e40c421b28 libcutils: android_reboot: save reboot reason in file
Save a string identifying the reason for last Android reboot or power
off in file /data/misc/recovery/last_reboot_reason .  This file may
be used for informing users of reboot or shutdown reasons at next
boot, and for other diagnostic purposes.

Bug: 30994946
Test: Manual: reboot, setprop sys.powerctl
Change-Id: I01e44473fdd21b33e9e4dced77aba9a66b6d3755
2017-02-02 04:01:05 +00:00
Todd Poynor
061778a8da libcutils: android_reboot: add thermal shutdown command
Add ANDROID_RB_THERMOFF command to android_reboot(), denoting a power
off due to thermal limits exceeded.  When this command is used, Android
may provide notification to the user about the potentially unexpected
power off at next boot.

Bug: 30994946
Test: Manual: setprop sys.powerctl thermal-shutdown
Change-Id: If2cde1b6a3c281a5750b50295412a4801ed5b2f2
2017-02-02 03:59:30 +00:00
Josh Gao
ac91b0c452 Revert "Give crash_dump CAP_SYS_PTRACE."
This reverts commit 36397cb168.

Bug: http://b/34853272
Test: debuggerd -b `pidof system_server`
Test: debuggerd -b `pidof zygote`
Change-Id: Ibccbccd956779f268d498a52aa737c1959538831
2017-02-01 17:55:22 -08:00
Evgenii Stepanov
2bd3e9cefd Merge "Disable integer sanitization on host." am: afe25958b6 am: ac3cf2ea9d am: ee5a545b7a
am: cad514cdd7

Change-Id: I71dc02174b0295741268231becdb8ada916ab3dc
2017-02-01 19:49:36 +00:00
Evgenii Stepanov
54c7886c40 Disable integer sanitization on host.
Test: NFC until https://android-review.googlesource.com/#/c/329510
Change-Id: I4d1bb66821b2984bbee12438cfd72b9b63d56605
2017-01-31 16:33:53 -08:00
Elliott Hughes
5881843c59 Merge "Support arbitrary-length properties in property_list." am: c8121ba029 am: 92aab6dbd1 am: be34e5661d
am: d5df20a2f3

Change-Id: I73e01d65fd3df3ae9f64c47e2d4148d2c055fb82
2017-01-27 07:55:56 +00:00
Treehugger Robot
c8121ba029 Merge "Support arbitrary-length properties in property_list." 2017-01-27 03:18:04 +00:00
Elliott Hughes
4eacd70f85 Support arbitrary-length properties in property_list.
Bug: http://b/33926793
Test: visual inspection
Change-Id: Ida84c3aaafa5411a9886f8d3d45679fd60ddc00d
2017-01-26 17:33:12 -08:00
George Burgess IV
c06216f8ac Merge "Add mode bits to a call to open with O_CREAT" am: 294f7312dd am: 990c4c611b am: 88cd8ee286
am: 67878340ca

Change-Id: I0f58bd91565719e1169311e718deb232dc0d2694
2017-01-26 07:06:28 +00:00
George Burgess IV
09175a0264 Add mode bits to a call to open with O_CREAT
Open with O_CREAT needs mode bits: https://linux.die.net/man/3/open

Found by running clang FORTIFY over AOSP.

Bug: 32073964
Test: Now builds with clang FORTIFY.
Change-Id: Iee4c93c5482f510e0adf8104c27e394b5d87ec88
2017-01-25 17:31:43 -08:00
Vijay Venkatraman
32e3fee0c3 Merge "Revert "Revert "Exporting C headers from system/core""" am: 01678a0c84 am: e6588b4bfa am: 2d37a4ff16
am: 48f756e5aa

Change-Id: I4d63b6e6d4949fb06d60abf755cc9443fd46c23f
2017-01-25 23:48:01 +00:00
Vijay Venkatraman
01678a0c84 Merge "Revert "Revert "Exporting C headers from system/core""" 2017-01-25 23:37:01 +00:00
Josh Gao
17e6df25d2 Merge "Give crash_dump CAP_SYS_PTRACE." am: 9e60a54f67 am: a417d90e36 am: 55cb039f55
am: e5c8e7ddaf

Change-Id: I66c1b0751eada4047e5ce6a19634bc3912924280
2017-01-25 21:40:08 +00:00
Vijay Venkatraman
651f8383e6 Revert "Revert "Exporting C headers from system/core""
This reverts commit a3f2be2b73.

Test: compile
Change-Id: I04b3a8e47e1fa3eb9d80c14ae3a90c68a780e858
2017-01-25 12:50:29 -08:00
Josh Gao
36397cb168 Give crash_dump CAP_SYS_PTRACE.
CAP_SYS_PTRACE is needed to ptrace processes that have capabilities
greater than their bounding set. Eventually, this will still be an
improvement, because we can ptrace attach, and then turn on a seccomp
filter that blocks further attaches.

Bug: http://b/34694637
Test: debuggerd `pidof system_server`
Change-Id: I4b9da164ec1fbb5060fdba590e886ac24b6a0785
2017-01-25 11:48:23 -08:00
Elliott Hughes
9a617138cc Merge "Remove unused klog_get_level." am: acdb06de6b am: 5ecc8d2439 am: d505d0c747
am: 14f12ddabd

Change-Id: I9cd92641a4df122429e416069638ff5cf2ba3e03
2017-01-25 16:50:13 +00:00
Elliott Hughes
acdb06de6b Merge "Remove unused klog_get_level." 2017-01-25 16:39:11 +00:00
Vijay Venkatraman
7ecee40df5 Merge "Revert "Exporting C headers from system/core"" am: 22b7f76a00 am: 16aac283f4 am: ebc9f4eb58
am: 061ed4de3e

Change-Id: Ic5d71373b0a84dd4bcf75acbc0e745ca4f99de3c
2017-01-25 00:59:42 +00:00
Vijay Venkatraman
a3f2be2b73 Revert "Exporting C headers from system/core"
This reverts commit 3c6763ca21.

Change-Id: If3b3e106478d28a5df927d57649abdca0a99dd0e
2017-01-25 00:44:08 +00:00
Vijay Venkatraman
8786e488c8 Merge "Exporting C headers from system/core" am: 897bc9b2b3 am: e6464ca571 am: e7bbb3c4b0
am: 561ac663a3

Change-Id: I87fcb2ac64d9646093e34ba5c67ab9747e2e66fb
2017-01-24 22:52:19 +00:00
Vijay Venkatraman
3c6763ca21 Exporting C headers from system/core
Moved headers from include/libcutils and include/liblog to
libcutils/include and liblog/include respectively, so they can be
exported via these libs. They needed to be moved since Soong does
not allow export from external folder.

Added symlink from old locations. They are needed since Soong
includes system/core/include by default. Once all modules are
cleaned up to explicitly add the required libs, the symlinks will be
removed.

Also added liblog_vndk_headers that exports a special log/log.h for
VNDK.

Moved headers of libcutils to libcutils_headers. They should be used
by modules for header-only inlines. Added libcutils_headers as
dependency of libcutils.

Added libcutils_vndk_headers that exports a special cutils/log.h
deprecating usage of the file. A later CL will deprecate the one in
libcutils_headers

Test: Add above libs to shared lib of local module
Change-Id: I6e1f9c5f23d8b6eae13dc3b7e5dfe7fae93b8510
2017-01-22 19:45:38 -08:00
Jaekyun Seok
3e1bddf9dd Merge "Load default/build props from each partition" am: 8dbab358f0 am: 57337e7791 am: ac747ef65a
am: f184d8bf47

Change-Id: I867e61238287e2e76049ef65cfe408b03691c5eb
2017-01-20 05:40:43 +00:00
Treehugger Robot
8dbab358f0 Merge "Load default/build props from each partition" 2017-01-20 03:58:52 +00:00
Jeff Sharkey
84dc96227d Merge "Define GID range for external data and OBBs." am: 1e7cdf3c7d am: d150012349 am: 23b6547230
am: b1e89ec14f

Change-Id: If94a9fd76e895f922f8b5f6ed99b871b5febb3f9
2017-01-19 16:39:37 +00:00
Josh Gao
85401cca56 Merge "debuggerd: advance our amazing bet." am: 230201dcbf am: 11b938e881 am: 787f1b29d0
am: 1b1e416fcc

Change-Id: Id6387b7f7ce6aac7ee1ac68ffcf76e69f5c3a924
2017-01-19 00:45:12 +00:00
Jeff Sharkey
7e5d0b1fae Define GID range for external data and OBBs.
To quickly answer the question of "how much data is a UID using?" we
need a GID range to label files on external storage, similar to
the GID ranges already defined for cached and shared data.

Also define a new GID that will be used to label the OBB files shared
between all users under /data/media/obb.

Test: builds, newly added tests pass
Bug: 34263266
Change-Id: I16fb7d166c3dcdeafbf477162d191d3b73ae8ac2
2017-01-18 17:11:05 -07:00
Jaekyun Seok
de21de7a42 Load default/build props from each partition
The following files will be loaded additionally.
- /odm/default.prop and /vendor/default.prop for default props.
- /odm/build.prop for build props.

The props files must follow the following priority order.
- /default.prop > /odm/default.prop > /vendor/default.prop
- /system/build.prop > /odm/build.prop > /vendor/buid.prop

Test: tested default/build prop files with enabling early mount, but
didn't test files of odm partition because odm partition doesn't
exist now.
Bug: 34116668
Change-Id: I946d076dae38f2288865dd986fb16d801d4abcc0
2017-01-19 08:45:40 +09:00
Josh Gao
cbe70cb0a8 debuggerd: advance our amazing bet.
Remove debuggerd in favor of a helper process that gets execed by
crashing processes.

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
2017-01-17 13:57:57 -08:00
Elliott Hughes
e04c3b0533 Remove unused klog_get_level.
Every little helps...

Bug: N/A
Test: builds
Change-Id: Ibcac5cda1619420c95903211ed0b96af81351f9e
2017-01-13 18:14:12 -08:00
Wei Wang
fc453321df Merge "libcutils: change klog_level to KLOG_INFO_LEVEL" am: 5e9863bf63 am: 974dd6291e am: c87d4ce758
am: a06b862257

Change-Id: I83876ce9b0258bc8c5217043f6ea9810a9bfd7a8
2017-01-13 08:22:40 +00:00
Wei Wang
677ba31db2 libcutils: change klog_level to KLOG_INFO_LEVEL
Some of Android componets e.g. init have migrated to use base/logging to get rid
of klog utilities. However, without explicit initilization, the default
klog_level is set to 3 which masks the logwrap output.
This patch sets default klog_level to KLOG_INFO_LEVEL to make
android_fork_execvp_ext log available.

Bug: 34256270
Test: manual
Change-Id: Ibe74707a92c954053cd0e6828a984fbd72b4acae
2017-01-12 22:18:46 -08:00
Mark Salyzyn
271a1a7cda resolve merge conflicts of a45b1d6f3 to master
Test: compile
Bug: 30465923
Change-Id: I648855539df3cfa176c6ecac19b6a562ba6feaf7
2017-01-11 11:41:38 -08:00
Mark Salyzyn
01e12b4ee7 Merge "liblog: use log/log.h when utilizing ALOG macros" 2017-01-11 19:07:17 +00:00
Mark Salyzyn
30f991f251 liblog: use log/log.h when utilizing ALOG macros
Test: compile
Bug: 30465923
Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2017-01-11 09:31:15 -08:00
Andre Eisenbach
511dd3b3b4 Merge "Allow Bluetooth HAL to access /sys/class/rfkill" am: 6ad690dfd4 am: a398921635 am: d969153aad
am: bb5ca97809

Change-Id: I348245df98cc42fb37555bb2fa7b904ff7a53713
2017-01-11 03:13:51 +00:00
Andre Eisenbach
8097210093 Allow Bluetooth HAL to access /sys/class/rfkill
Test: compiles; HAL can write rfkill state
Change-Id: I5815a1f50ef8d09bf83541a6d2389b61bd007306
2017-01-10 23:40:20 +00:00
Myles Watson
8c9ee16294 libcutils: Use strnlen for default property values am: e67abec514 am: 6632536c0d am: f957e56909
am: 9bc7869b79

Change-Id: Iba1796493404418216f4f25078ddebac6e8034d5
2016-12-22 19:51:50 +00:00
Myles Watson
2fd5a6425d Use clang-format to fix up properties.c am: 22c0962ab9 am: 9fdf778dd0 am: 57bbd25bd5
am: b35816288c

Change-Id: Ibe4238bef5428858f59f3dc8f38b09ea12a76cb6
2016-12-22 19:51:43 +00:00
Myles Watson
e67abec514 libcutils: Use strnlen for default property values
Add unit tests to test the corner cases.

Test: unit tests pass before and after the change.
Change-Id: Idafeb8354cd6c7db2a68cd398dafe153453a3940
2016-12-22 09:21:06 -08:00
Myles Watson
22c0962ab9 Use clang-format to fix up properties.c
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 100

Test: unit tests pass
Change-Id: Ie1a9bf85c001ef1a2dcdafdc5bf696b9267116f7
2016-12-22 09:20:57 -08:00
Nick Kralevich
f8eadb6b9c Merge "fs_config.c: make *.prop files 0600" am: ebc39117ee am: e733fac3ef am: ab72558bcb
am: 88f3f8837b

Change-Id: Ib1a3a51ee1e7228cb587400da9fb6eecac4c0783
2016-12-17 01:27:51 +00:00
Nick Kralevich
5f9fa90425 fs_config.c: make *.prop files 0600
Enforce that the only API for reading properties is through the property
server, not by reading the (system|vendor|rootfs) *.prop files.

Test: Device boots and no property errors.
Change-Id: Ibb6ed4e74a80cac00010c707d7574f8e92fc6448
2016-12-16 14:54:02 -08:00
TreeHugger Robot
4769dab866 Merge changes I09b11db0,I774b1a44
* changes:
  libcutils: add file permission for storaged
  storaged: add storaged native daemon
2016-12-16 05:13:39 +00:00
Jeff Sharkey
c35144844b Merge "Define range of GIDs for cached app data." am: da94f09e22 am: ac13675071 am: 1ad4090e4e
am: 40717394bd

Change-Id: I74e4e62cd69d3696698609e010bf08ad86daa0f4
2016-12-16 01:15:39 +00:00
Jin Qian
6c9477a244 libcutils: add file permission for storaged
Change-Id: I09b11db0a7a94b51b5b279b3e4ec58ea9f0c12d7
2016-12-15 15:56:39 -08:00
Jeff Sharkey
da94f09e22 Merge "Define range of GIDs for cached app data." 2016-12-15 21:46:31 +00:00
Sandeep Patil
9b2e207099 Merge "socket: uevent: use SO_RCVBUF instead of SO_RCVBUFFORCE" am: 0a2080bced am: 571e246983 am: c345388bea
am: e432dc58c1

Change-Id: Iab5bafe3e156dfb2fc75634c8d25b5f67991915e
2016-12-14 19:54:35 +00:00
Jeff Sharkey
dff44709cf Define range of GIDs for cached app data.
To support upcoming disk usage calculation optimizations, this change
creates a new GID for each app that will be used to mark its cached
data.  We're allocating these unique GIDs so that we can use
quotactl() to track cached data on a per-app basis.

This change also tightens up the implementation of both the cache
and shared GID calculation to ensure that they stay inside the valid
ranges, and includes tests to verify.

Test: builds, boots, tests pass
Bug: 27948817
Change-Id: Ie4377e5aae267f2da39a165888139228995987cb
2016-12-13 13:28:08 -07:00
Sandeep Patil
5fee496e62 socket: uevent: use SO_RCVBUF instead of SO_RCVBUFFORCE
The SO_RCVBUFFORCE option requires the caller of uevent_create_socket()
to have net_admin capabilities.

Set platform default rcv/snd buffer sizes to 256kb that will always be
overridden by the device/target. However, it will allow
ueventd / healthd to use the uevent_create_socket() API w/o requiring
the net_admin capability.

Note: All devices override the buffer sizes according to the technology
maximum to at least ~8MB. So, the init.rc change here is to make sure
platform code can work w/o any overrides.

Test: no SELinux failures for healthd with 'net_admin' removed.

Bug: https://b/32733887

Change-Id: Ida346468cd550ad07901bf3a78ad508939849906
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-12-09 15:16:28 -08:00
Elliott Hughes
d0de8660a6 Merge "Use hasmntopt(3) rather than reinventing the wheel." am: 769a5a1962 am: 8656ed109b am: 5dd53bf466
am: 4d7fbc3923

Change-Id: I071f430fa4ed033848353fdf59e972eb474be4a4
2016-11-30 23:12:30 +00:00
Elliott Hughes
8656ed109b Merge "Use hasmntopt(3) rather than reinventing the wheel."
am: 769a5a1962

Change-Id: I62541c0ff6961888239a7686bb37115b39fc787b
2016-11-30 22:49:53 +00:00
Elliott Hughes
769a5a1962 Merge "Use hasmntopt(3) rather than reinventing the wheel." 2016-11-30 22:32:44 +00:00
Mark Salyzyn
1f383e910f Merge "libcutils: tests" am: bac388e424 am: 6878cd20e6 am: 2e88b5c803
am: 7df147f3bb

Change-Id: I60fea7cd1e8f9c3e5a0404db3b075469fe827a7a
2016-11-30 17:44:11 +00:00
Elliott Hughes
8c1838823a Use hasmntopt(3) rather than reinventing the wheel.
Bug: N/A
Test: "power off" still works
Change-Id: I11d3dc22f98ac71608c9929a3fd43319c787d49e
2016-11-30 09:37:17 -08:00
Mark Salyzyn
6878cd20e6 Merge "libcutils: tests"
am: bac388e424

Change-Id: I86a00ea257985836400b530c1e60bdc5e070dd00
2016-11-30 17:28:39 +00:00
Mark Salyzyn
678194ddac libcutils: tests
Respect "android" and "not_windows" (linux + darwin). This
means the string test and control support routines were not
being tested on android.

Test: gTest libcutils_test
Bug: 32450474
Change-Id: I9505fefeb0a4a8c5b54aa637812b4f3c07c2893c
2016-11-29 10:08:12 -08:00
Mark Salyzyn
3644309528 Merge "libcutils: sdk(mac) build error (part deux)" am: ed0a48c617 am: 5a411029de am: 01f8f8c586
am: c43b02f2cb

Change-Id: Idea08d579dd3d1bfbd98d6cbe2e67781e731db3a
2016-11-17 17:25:44 +00:00
Mark Salyzyn
60b4a8bc56 Merge "libcutils: sdk(mac) build error" am: 231d1ac640 am: 7bc8810a4a am: 190e9cc65d
am: c03f3c7186

Change-Id: Id65101b9dccdb7ef65bbb96fa1cdef3d3ac38569
2016-11-17 16:53:13 +00:00
Mark Salyzyn
5a411029de Merge "libcutils: sdk(mac) build error (part deux)"
am: ed0a48c617

Change-Id: Id6d3a5568a3383111592fd097ab8c96568783522
2016-11-17 16:43:06 +00:00
Mark Salyzyn
0958b18da0 libcutils: sdk(mac) build error (part deux)
Test: Build
Bug: 32450474
Change-Id: I92cca30217715779a9db6a60e2e4831a20cec3d4
2016-11-17 08:33:26 -08:00
Mark Salyzyn
7bc8810a4a Merge "libcutils: sdk(mac) build error"
am: 231d1ac640

Change-Id: Icca67be8194faa296b93e9bfec2a15002ac06147
2016-11-17 16:19:34 +00:00
Mark Salyzyn
6b652160d1 libcutils: sdk(mac) build error
Surprise surprise, MAC sdk build has F_GETFD & not TEMP_FAILURE_RETRY.
Revert code to original form with the three alternatives for all OSii.

Test: Build
Bug: 32450474
Change-Id: Ia7361d8107675a620968d8395c5e2351ad364d29
2016-11-17 08:05:16 -08:00
Mark Salyzyn
95dbf68245 Merge "libcutils: move cutils/files.h to cutils/android_get_control_file.h" am: 8c41e791ed am: 809dee506e am: 26545e3c60
am: 124b7cb732

Change-Id: I575ef1a45746c14b5c01301d8336307f2575a4ba
2016-11-17 16:02:50 +00:00
Mark Salyzyn
809dee506e Merge "libcutils: move cutils/files.h to cutils/android_get_control_file.h"
am: 8c41e791ed

Change-Id: Ifbc00285da734859d590153a7c6cfc8e51c014f9
2016-11-17 15:33:02 +00:00
Mark Salyzyn
52bd37e633 libcutils: move cutils/files.h to cutils/android_get_control_file.h
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
2016-11-16 15:56:56 -08:00
Mark Salyzyn
325aa70591 libcutils: fs_config.c beautification
surfaceflinger has an odd indent and wrap.

SideEffects: None
Test: compile
Change-Id: I5183ab200dbcd13efb0727cb91db5b12018ae804
2016-11-04 14:12:31 -07:00
Mark Salyzyn
d32e7f4703 Merge "libcutils: sockets_test breaks MAC build"
am: 8d339e940f

Change-Id: I4dbc000a63c45f82a32012629eec855c60c17b5a
2016-11-04 19:51:07 +00:00
Mark Salyzyn
44ba139bba libcutils: sockets_test breaks MAC build
- Neuter SOCK_NONBLOCK and SOCK_CLOEXEC if they are not defined.
- F_SETFL O_NONBLOCK after socket() call.
- Correct environment reference (we recently changed handler to
  replace non-ascii and non-numericals with '_' for env tag).

Test: libcutils_test32 --gtest_filter=SocketsTest.android_get_control_socket
Bug: 32450474
Change-Id: I409a8c2c78e5f057af5fd6251cbd8657018be22b
2016-11-04 12:27:43 -07:00
Mark Salyzyn
db9ad76576 libcutils: klog inherit android_get_control_file("/dev/kmsg")
am: c377843258

Change-Id: Ic520e605639c879b7bf9f5e5bab8e526c69df395
2016-11-04 14:43:42 +00:00
Mark Salyzyn
4109c433f1 logd: set executable's capabilities in file system
am: 0d2a1dcb49

Change-Id: Icb3fb18ee96be0ae250be153a1600eb4e8cd8408
2016-11-04 14:43:12 +00:00
Mark Salyzyn
c020d3fa6e libcutils: add android_get_control_file()
am: 0b034d9d7b

Change-Id: I7d0a58c12839dba59aa43b96e5a920d3c415efcf
2016-11-04 14:42:57 +00:00
Mark Salyzyn
4ffdd5d805 libcutils: add android_get_control_socket() test
am: 547e0dc45a

Change-Id: I34b70a4e1eba070ad58068a851047fe41680a973
2016-11-04 14:42:50 +00:00
Mark Salyzyn
c377843258 libcutils: klog inherit android_get_control_file("/dev/kmsg")
If the file descriptor is in the environment, use it.

Test: compile
Bug: 32450474
Change-Id: Id208b11b727a44dc861a141130a644d7d8009c5f
2016-11-03 13:34:27 -07:00
Mark Salyzyn
0d2a1dcb49 logd: set executable's capabilities in file system
Add CAP_SYSLOG, CAP_AUDIT_CONTROL and CAP_SETGID, set
uid and gid to AID_LOGD, and permissions user and group
read and execute only.

Fix up indents for in table for clarity.

Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
      Manually inspect owner and group for /system/bin/logd
Bug: 32450474
Change-Id: I5183ab200dbcd13efb0727cb91db5b12018ae804
2016-11-03 13:34:27 -07:00
Mark Salyzyn
0b034d9d7b libcutils: add android_get_control_file()
Solve one more issue where privilege is required to open a file and
we do not want to grant such to the service. This is the client side
of the picture, init is the server. The file's descriptor was placed
into the environment as "ANDROID_FILE_<path>" where non-alpha and
non-numeric characters in the <path> are replaced with _ and this
function picks the file descriptor up.

Added definition ANDROID_FILE_ENV_PREFIX ("ANDROID_FILE_") and
android_get_control_file() prototype in a new include <cutils/files.h>

android_get_control_file() checks if the resulting file descriptor is
valid, open and matches the name reference, which on purpose will fail
if a symbolic link is in the path rather than using a fully qualified
path.  Add gTest unit test for both.

Test: gTest libcutils_test --gtest_filter=FileTest.android_get_control_file
Bug: 32450474
Change-Id: I2d0310a1727f1e393a00d9fc7e6cf5d028f27905
2016-11-03 13:34:20 -07:00
Mark Salyzyn
547e0dc45a libcutils: add android_get_control_socket() test
android_get_control_socket() checks if the resulting file descriptor
is valid, open and matches the socket bound name reference, which on
purpose will fail if a symbolic link is in the path rather than using
a fully qualified path.  If there are any non-alpha and non-numeric
characters in the name, they are replaced with _.  Add unit test.

Test: gTest libcutils_test --gtest_filter=SocketTest.android_get_control_socket
Bug: 32450474
Change-Id: I27a6419012033ef8bd6ca04f3e479d01264d8c49
2016-11-03 13:34:13 -07:00
Robert Sesek
0dad6acaba Merge "Add fs_config entries for the webview_zygote."
am: 2260c09983

Change-Id: I4c4ae12dc5a0625a4e73905ff11e2d5461aec237
2016-11-03 15:32:23 +00:00
Robert Sesek
a2ceaf6b8b Add fs_config entries for the webview_zygote.
The webview_zygote is a non-root zygote process that creates isolated_app
children for rendering web content. It needs:
- CAP_SETUID and CAP_SETGID to change the UID of the new child process.
- CAP_SETPCAP to clear the capability bounding set after forking.

Test: m
Test: angler boots

Bug: 21643067
Change-Id: I986fa04be54e812f5dd2afa14e5d2d3e474e2b10
2016-10-31 10:33:36 -04:00
Roshan Pius
c8356e5ca7 Merge "Rename 'wifi_legacy_hal' to 'android.hardware.wifi@1.0-service'"
am: 4376d21e7f

Change-Id: I2e187e4374fba232f0641c2fb447a281e507e216
2016-10-25 23:30:07 +00:00
Roshan Pius
f6ac81ea4d Rename 'wifi_legacy_hal' to 'android.hardware.wifi@1.0-service'
Add netlink permissions for the new wifi HAL daemon name.

Bug: 31821133
Test: Compiled and ensured that the permission denials are no longer
present in logs.

Change-Id: If939df4760d9f7e85f0f134617d3a79030e09347
2016-10-24 09:30:10 -07:00
Mark Salyzyn
8a7297a09f Merge "system/core: preparation to pull back interfaces from android/log.h"
am: 27d2d49f48

Change-Id: I604bb1d4cf62636663fa92e3d14a55887dbcae23
2016-10-20 18:03:57 +00:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00