File tree 1 file changed +10
-7
lines changed 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,16 @@ static Result<std::string> ComputeContextFromExecutable(const std::string& servi
88
88
free (new_con);
89
89
}
90
90
if (rc == 0 && computed_context == mycon.get ()) {
91
- return Error () << " File " << service_path << " (labeled \" " << filecon.get ()
92
- << " \" ) has incorrect label or no domain transition from " << mycon.get ()
93
- << " to another SELinux domain defined. Have you configured your "
94
- " service correctly? https://source.android.com/security/selinux/"
95
- " device-policy#label_new_services_and_address_denials. Note: this "
96
- " error shows up even in permissive mode in order to make auditing "
97
- " denials possible." ;
91
+ std::string error = StringPrintf (
92
+ " File %s (labeled \" %s\" ) has incorrect label or no domain transition from %s to "
93
+ " another SELinux domain defined. Have you configured your "
94
+ " service correctly? https://source.android.com/security/selinux/"
95
+ " device-policy#label_new_services_and_address_denials" ,
96
+ service_path.c_str (), filecon.get (), mycon.get ());
97
+ if (security_getenforce () != 0 ) {
98
+ return Error () << error;
99
+ }
100
+ LOG (ERROR) << error;
98
101
}
99
102
if (rc < 0 ) {
100
103
return Error () << " Could not get process context" ;
You can’t perform that action at this time.
0 commit comments