Age | Commit message (Collapse) | Author |
|
Android now allows ro. properties to have arbitrary lengths. Two
changes need to happen to support this:
1) The length check in setprop.c before attempting to set a property
needs to be removed for ro. properties
2) __system_property_read_callback() must be used in place of
__system_property_get() in getprop.c as only the former is capable
of reading properties with size > 92 characters.
Bug: 23102347
Bug: 34954705
Change-Id: Ib8565a3e6d987dd5e6a5fe790e804ecf8ad1e020
|
|
Fixes:
toys/android/getprop.c:56:39: warning: incompatible pointer types
passing 'void (void *, const char *, const char *)' to parameter of
type 'void (*)(void *, const char *, const char *, uint32_t)'
(aka 'void (*)(void *, const char *, const char *, unsigned int)')
[-Wincompatible-pointer-types]
__system_property_read_callback(pi, read_callback, NULL);
^~~~~~~~~~~~~
|
|
(Broken out of a larger patch, fixed the other part a different way.)
|
|
Android O removes name length limit for system properties.
Use __system_property_read_callback instead of deprecated
__system_property_read in getprop and remove check for
property name length in setprop.
Test: adb shell setprop debug.test.very.very.long.property.name valueforpropertywithlongname
Test: adb shell getprop | grep debug.test.very.very.long.property.name
Bug: http://b/33926793
Change-Id: I57ca99ea33283d069cd1b7b9f110ec9fb27f3d19
|
|
The "lsm" portability stuff could abstract this away, but Android doesn't
need it, and getprop is meaningless on non-Android. (And if you're just
building with the NDK, on recent enough versions of Android you won't be
able to read most of the system properties anyway because access to them is
increasingly restricted by selinux.)
|
|
Removes the dependency on libcutils for everything except ps.
|
|
If toybox was compiled statically e.g. for use in a recovery ramdisk,
it would not build after b66a29a. This is because libselinux already
exports a selinux_log_callback() function which getprop.c is trying
to override.
This change simply makes the second symbol static, since it is only
used in a function table so we do not actually need to export it
from toybox.
Change-Id: I603258877ae2286660df35738bbf4f4285df5b54
Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
|
|
Add support for a -Z option to getprop that will either print the
SELabel of a given property if one is provided or print all properties
that have been set along with their SELabel.
Also, correct a memory leak when freeing TT.nv.
|
|
Use qstrcmp instead of alphasort (which expects struct dirent arguments).
Don't use perror_exit because property_list doesn't set errno.
|
|
(I commented out the android-only #include in getprop to do what compile
testing I could, and then forgot to uncomment it.)
|
|
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
|
|
|