android_system_core/include
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
..
android liblog: restructure log/log.h and android/log.h 2016-10-24 11:03:49 -07:00
backtrace Test for _WIN32 in instead of USE_MINGW. 2016-10-05 09:37:44 -07:00
cutils libcutils: add android_get_control_file() 2016-11-03 13:34:20 -07:00
log log/logd.h should point to log/log.h 2016-10-25 09:21:00 -07:00
nativebridge Upgrade native bridge to version 3 to support namespace 2016-10-25 11:11:38 -07:00
private Add UID for vehicle network 2016-10-28 12:08:07 -07:00
system [qemu]: Fix payload size format in qemu_pipe_frame_send() 2016-09-30 13:58:11 +02:00
sysutils Revert "Sigh, more vendors linking against hidden APIs." 2015-03-20 23:51:36 +00:00
utils system/core: preparation to pull back interfaces from android/log.h 2016-10-20 08:11:39 -07:00
ziparchive Add functions in recovery/minzip to libziparchive 2016-10-15 23:16:34 -07:00