0b034d9d7b
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 |
||
---|---|---|
.. | ||
android_reboot.h | ||
ashmem.h | ||
atomic.h | ||
bitops.h | ||
compiler.h | ||
config_utils.h | ||
debugger.h | ||
files.h | ||
fs.h | ||
hashmap.h | ||
iosched_policy.h | ||
jstring.h | ||
klog.h | ||
list.h | ||
log.h | ||
memory.h | ||
misc.h | ||
multiuser.h | ||
native_handle.h | ||
open_memstream.h | ||
partition_utils.h | ||
properties.h | ||
qtaguid.h | ||
record_stream.h | ||
sched_policy.h | ||
sockets.h | ||
str_parms.h | ||
threads.h | ||
trace.h | ||
uevent.h |