Commits

Anonymous committed e4e2dc4

Do not try to restorecon if selinux is disabled

debuggerd tries to restorecon on the tombstones directory which fails
when SELinux is not enabled in the kernel. That would return an error
condition to debuggerd which would then abort its attempt to dump the
stacks of the failing program.

Fix it here in case there are other places that might call this in the
future. Currently the only other caller is android_os_SELinux.cpp JNI
code.

Change-Id: Id73796a70174333b61fd04ee6b1d99fccbea8116

  • Participants
  • Parent commits 0311c4f
  • Branches seandroid-4.0.4

Comments (0)

Files changed (1)

 int selinux_android_restorecon(const char *pathname)
 {
 
+	if (is_selinux_enabled() <= 0)
+		return 0;
+
 	__selinux_once(fc_once, file_context_init);
 
 	int ret;