bionic's __system_property_add() now expands the property area as needed
by mapping in more pages. Rather than duplicate the mapping code, move
it inside bionic and have bionic's __system_property_area_init() set up
the first page.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit f14eef0c3c)
Change-Id: Ieb94caab1527c71f2155efe3795490b0ea215a29
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.
Make the /dev/__properties__ file accessible, so an app can
get properties directly from the file, rather than relying on
environment variables.
Preserve the environment variable for compatibility with pre-existing
apps.
Bug: 8045561
(cherry picked from commit 7ece0a862c)
Change-Id: I762da21ef4075f288745efed0ec7d16c2b71303c
Internally, replace the watchlist array with a hashmap since the array
assumes properties are enumerated in a consistent order and foreach()
probably won't. (find_nth() never guaranteed this either but it usually
worked in practice.)
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit 389e358017)
Change-Id: I1db3137b130474f4bb205f01f0bdcf37cf974764
* changes:
init: fix copying boot properties
toolbox: hide property implementation from watchprops
init: verify size of property buffers passed to property_get
init: move the system property writer implementation
init: switch property_get to use __system_property_get
The previous patch "init: verify size of property buffers passed
to property_get" incorrectly modified one of the callers,
resulting in ro.serialno, ro.bootmode, ro.baseband, and
ro.bootloader always being set to their default values.
Bug: 9469860
(cherry picked from commit 67e3663fc9)
Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
Verify that the buffer passed as the value parameter to property_get
is always big enough.
(cherry picked from commit 88ac54a4e8)
Change-Id: Iacc2b42bfe4069e0bfcbb1c48474f30126a93139
Move the system property writer implementation into bionic to keep
it next to the reader implementation and allow for better testing.
(cherry picked from commit 9f5af63501)
Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0
When transferring files over 4 GiB with adb, the size of the transfer
is misreported.
Change-Id: Ia3d4cae1e9f82b4f7432341820b101ea9a44f85b
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
We should also add a test for heap corruption, but I failed to come up
with a kind of corruption that dlmalloc actually detects (rather than
just crashing accidentally).
Change-Id: I7457e732729635b171ffc44517c3de71f55608e6
Property triggers may cause an action to be queued twice, resulting
in a loop in the action queue. Keep actions that are not on the queue
in the list_empty state (act->qlist->next == act->qlist), and only
add them to the list if they are in that state.
Bug: 8335133
Change-Id: I3a3ec18176cf19cbaa3a45220a03c7560eacfe79
1. bad return status make it return uninitialized prefixLength with a magic
number in android_net_utils_runDhcpCommon()
2. it will make DhcpInfoInternal.makeLinkAddress() to throw
IllegalArgumentException when try to connect a Wifi AP
3. the exception will make system reboot, of cource it random.
Change-Id: Iabc0cd5b69c1316f4eeae0aa1b8a91444dca4562
Signed-off-by: Michael Wu <michaelstay@gmail.com>