From: Tomas Mraz Date: Mon, 23 Jun 2008 16:00:46 +0000 (+0200) Subject: Fixed call to setkeycreatecon. X-Git-Tag: cronie1.2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dbdfa5988d6ddbc3cd78533989791afb3bcbd0d;p=cronie Fixed call to setkeycreatecon. --- diff --git a/src/security.c b/src/security.c index 3e13cc8..ba14117 100644 --- a/src/security.c +++ b/src/security.c @@ -356,7 +356,7 @@ static int cron_change_selinux_range(user *u,security_context_t ucontext) { #endif syslog(LOG_ERR, "CRON (%s) ERROR:" - "Unauthorized range %s in MLS_LEVEL for user %s ", + "Unauthorized range %s in MLS_LEVEL for user %s", u->name, (char*)ucontext, u->scontext); return -1; } @@ -370,18 +370,18 @@ static int cron_change_selinux_range(user *u,security_context_t ucontext) { } } - if ((setexeccon(ucontext) < 0) && (setkeycreatecon(ucontext))) { + if (setexeccon(ucontext) < 0 || setkeycreatecon(ucontext) < 0) { if (security_getenforce() > 0) { syslog(LOG_ERR, "CRON (%s) ERROR:" - "Could not set exec context to %s for user", + "Could not set exec or keycreate context to %s for user", u->name, (char*)ucontext); return -1; } else { syslog(LOG_ERR, "CRON (%s) ERROR:" - "Could not set exec context to %s for user, " + "Could not set exec or keycreate context to %s for user," " but SELinux in permissive mode, continuing", u->name, (char*)ucontext);