diff options
author | Tom Cherry <tomcherry@google.com> | 2017-10-12 09:43:32 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-10-17 12:27:05 -0500 |
commit | 11c385314ac0fac9694509639b03aa88a2ee5f6c (patch) | |
tree | 0e5bd7af90e2224daf2eaa42c2a0ad9b7b2d3389 /toys/android/setprop.c | |
parent | 46d2cda500242caae2ccf7cee71200d4bfe7c7a5 (diff) | |
download | toybox-11c385314ac0fac9694509639b03aa88a2ee5f6c.tar.gz |
Allow ro. properties to have arbitrary lengths
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
Diffstat (limited to 'toys/android/setprop.c')
-rw-r--r-- | toys/android/setprop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/android/setprop.c b/toys/android/setprop.c index ec411f41..14c24d9f 100644 --- a/toys/android/setprop.c +++ b/toys/android/setprop.c @@ -29,7 +29,7 @@ void setprop_main(void) // recognize most failures (because it doesn't wait for init), so // we duplicate all of init's checks here to help the user. - if (value_len >= PROP_VALUE_MAX) + if (value_len >= PROP_VALUE_MAX && !strncmp(value, "ro.", 3)) error_exit("value '%s' too long; try '%.*s'", value, PROP_VALUE_MAX - 1, value); |