From 1919000c897ccf0f88a5584faf3a2efc1a7a3c30 Mon Sep 17 00:00:00 2001 From: Sebastien RAILLET Date: Wed, 22 Sep 2021 16:54:31 +0200 Subject: dlt-daemon: create sockets using "android way" * Before this commit, dlt-daemon sockets were created inside /data/local/tmp. This works but have many drawbacks: - /data/local/tmp isn't always a tmpfs depending of the android system you have. Means sockets are potentially created on a filesystem which binds to a real device - as the sockets are created by the dlt-daemon itself, this prevent the usage of specific SELinux labels / contexts as they will inherit the label / context from its parent location (e.g the ones from /data/local/tmp). This prevent a fine control of the SELinux label / context that you would like to apply on them * This commit adapts the dlt-daemon in such way: - application and control sockets are now created inside /dev/socket which is the standard path for sockets on android - these sockets are now created by init (see dlt-daemon.rc) and their fds are recovered by dlt-daemon through a specific android API (dlt_daemon_unix_android_get_socket). If the fds can't be recovered, we fallback to the previous mechanism by creating by ourself the sockets (even if this will prevent SELinux label / context on this socket) - all these modifications have been put under compilation flag for android Signed-off-by: Sebastien RAILLET --- Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Android.bp') diff --git a/Android.bp b/Android.bp index 996ae85..96cd73d 100644 --- a/Android.bp +++ b/Android.bp @@ -29,7 +29,7 @@ cc_defaults { "-DDLT_DAEMON_USE_UNIX_SOCKET_IPC", "-DDLT_LIB_USE_UNIX_SOCKET_IPC", "-DCONFIGURATION_FILES_DIR=\"/vendor/etc\"", - "-DDLT_USER_IPC_PATH=\"/data/local/tmp\"", + "-DDLT_USER_IPC_PATH=\"/dev/socket\"", ] + [ "-Wno-unused-parameter", "-W", -- cgit v1.2.1