Merge "New "selinux.restorecon" control property." into mnc-dev
This commit is contained in:
commit
4d7f052afb
1 changed files with 10 additions and 3 deletions
|
|
@ -205,6 +205,16 @@ static int property_set_impl(const char* name, const char* value) {
|
||||||
if (!is_legal_property_name(name, namelen)) return -1;
|
if (!is_legal_property_name(name, namelen)) return -1;
|
||||||
if (valuelen >= PROP_VALUE_MAX) return -1;
|
if (valuelen >= PROP_VALUE_MAX) return -1;
|
||||||
|
|
||||||
|
if (strcmp("selinux.reload_policy", name) == 0 && strcmp("1", value) == 0) {
|
||||||
|
if (selinux_reload_policy() != 0) {
|
||||||
|
ERROR("Failed to reload policy\n");
|
||||||
|
}
|
||||||
|
} else if (strcmp("selinux.restorecon_recursive", name) == 0 && valuelen > 0) {
|
||||||
|
if (restorecon_recursive(value) != 0) {
|
||||||
|
ERROR("Failed to restorecon_recursive %s\n", value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prop_info* pi = (prop_info*) __system_property_find(name);
|
prop_info* pi = (prop_info*) __system_property_find(name);
|
||||||
|
|
||||||
if(pi != 0) {
|
if(pi != 0) {
|
||||||
|
|
@ -236,9 +246,6 @@ static int property_set_impl(const char* name, const char* value) {
|
||||||
* to prevent them from being overwritten by default values.
|
* to prevent them from being overwritten by default values.
|
||||||
*/
|
*/
|
||||||
write_persistent_property(name, value);
|
write_persistent_property(name, value);
|
||||||
} else if (strcmp("selinux.reload_policy", name) == 0 &&
|
|
||||||
strcmp("1", value) == 0) {
|
|
||||||
selinux_reload_policy();
|
|
||||||
}
|
}
|
||||||
property_changed(name, value);
|
property_changed(name, value);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue