Do not support systems without SELinux

This commit is contained in:
topjohnwu
2023-09-27 02:28:43 -07:00
parent ec115cd7e3
commit 5d07d0b964
6 changed files with 3 additions and 31 deletions
+1 -1
View File
@@ -458,7 +458,7 @@ void su_daemon_handler(int client, const sock_cred *cred) {
sigset_t block_set;
sigemptyset(&block_set);
sigprocmask(SIG_SETMASK, &block_set, nullptr);
if (!ctx.req.context.empty() && selinux_enabled()) {
if (!ctx.req.context.empty()) {
auto f = xopen_file("/proc/self/attr/exec", "we");
if (f) fprintf(f.get(), "%s", ctx.req.context.data());
}