selinux_android_restorecon: log if selinux is disabled
Right now selinux_android_restorecon will silently succeed if selinux is disabled which is confusing. This change adds a log statement that should help with debugging issues related to disabled selinux (see attached bug). Bug: 284277137 Test: presubmit Change-Id: I4ebc6400ac7188660658ef3cccfb7cbdc76c0f22
This commit is contained in:
parent
e1c842285b
commit
f8cf22eba8
1 changed files with 3 additions and 1 deletions
|
@ -633,8 +633,10 @@ static int selinux_android_restorecon_common(const char* pathname_orig,
|
|||
ftsflags |= FTS_XDEV;
|
||||
}
|
||||
|
||||
if (is_selinux_enabled() <= 0)
|
||||
if (is_selinux_enabled() <= 0) {
|
||||
selinux_log(SELINUX_WARNING, "SELinux: SELinux is disabled, skipping restorecon");
|
||||
return 0;
|
||||
}
|
||||
|
||||
__selinux_once(fc_once, file_context_init);
|
||||
|
||||
|
|
Loading…
Reference in a new issue