OSDN Git Service

libc: use more secure system properties if available
authorNick Kralevich <nnk@google.com>
Wed, 23 Jan 2013 17:28:35 +0000 (09:28 -0800)
committerNick Kralevich <nnk@google.com>
Wed, 23 Jan 2013 17:28:35 +0000 (09:28 -0800)
commit32417fb37642a1f975ec107e6b449ba71196db56
tree2a10ccaed29dd6ba733b4338d72fdb786633255f
parent778a68e1e57408be04806b5bfc3150aade44bcbf
libc: use more secure system properties if available

Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Modify system property handling so that we get the properties
from a root owned properties file, rather than using an
environment variable.  Fall back to the environment variable
if the file doesn't exist.

Bug: 8045561
Change-Id: I54f3efa98cf7d63d88788da5ce0d19e34fd7851a
libc/bionic/system_properties.c
libc/include/sys/_system_properties.h