init: service file command only opens existing files
Mixing open or create, along with attribute(MAC) and permissions(DAC)
is a security and confusion issue.
Fix an issue where fcntl F_SETFD was called to clear O_NONBLOCK, when
it should have been F_SETFL. Did not present a problem because the
current user of this feature does writes and control messages only.
Test: gTest logd-unit-tests and check dmesg for logd content.
Bug: 32450474
Bug: 33242020
Change-Id: I23cb9a9be5ddb7e8e9c58c79838bc07536e766e6
diff --git a/init/readme.txt b/init/readme.txt
index 7549e3c..36bf698 100644
--- a/init/readme.txt
+++ b/init/readme.txt
@@ -148,13 +148,10 @@
seclabel or computed based on the service executable file security context.
For native executables see libcutils android_get_control_socket().
-file <path> <type> <perm> [ <user> [ <group> [ <seclabel> ] ] ]
- Open/Create a file path and pass its fd to the launched process. <type> must
- be "r", "w" or "rw". User and group default to 0. 'seclabel' is the SELinux
- security context for the file if it must be created. It defaults to the
- service security context, as specified by seclabel or computed based on the
- service executable file security context. For native executables see
- libcutils android_get_control_file().
+file <path> <type>
+ Open a file path and pass its fd to the launched process. <type> must be
+ "r", "w" or "rw". For native executables see libcutils
+ android_get_control_file().
user <username>
Change to 'username' before exec'ing this service.