From dabf95fcf9c9f24d8de5d2585bffa37423d47b78 Mon Sep 17 00:00:00 2001
From: Marcela <marca@caladan.englab.brq.redhat.com>
Date: Tue, 27 May 2008 13:58:04 +0200
Subject: [PATCH] Remove unused function.

---
 src/funcs.h    |  2 --
 src/security.c | 51 --------------------------------------------------
 2 files changed, 53 deletions(-)

diff --git a/src/funcs.h b/src/funcs.h
index bc82639..b3b1cda 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -98,8 +98,6 @@ int cron_change_user( struct passwd *pw, char *homedir );
 
 int cron_get_job_context( user *u, void *scontextp, void *file_contextp, char **envp );
 
-int cron_change_selinux_context( user *, void *scontext, void *file_context );
-
 int get_security_context(const char *name, 
 			 int crontab_fd, 
 			 security_context_t *rcontext, 
diff --git a/src/security.c b/src/security.c
index cdcc14b..2c20f90 100644
--- a/src/security.c
+++ b/src/security.c
@@ -319,57 +319,6 @@ static int cron_get_job_range(user *u, security_context_t *ucontextp, char **job
 }
 #endif
 
-int cron_change_selinux_context(user *u, void *scontext, void *file_context) {
-#ifdef WITH_SELINUX
-	if (is_selinux_enabled() <= 0)
-		return 0;
-
-	if (scontext == 0L) {
-		if (security_getenforce() > 0) { 
-			log_it( u->name, getpid(), "NULL security context for user", "");
-			return -1;
-		} 
-		else {
-			log_it( u->name, getpid(), 
-				"NULL security context for user, "
-				"but SELinux in permissive mode, continuing",
-				"");
-			return 0;
-		}
-	}
-	
-	if (file_context) {
-		if (!cron_authorize_context( scontext, file_context)) {
-			if (security_getenforce() > 0) {
-				syslog(LOG_ERR,
-				       "CRON (%s) ERROR:"
-				       "Unauthorized exec context to SELINUX_ROLE_TYPE %s for user", 
-				       u->name, (char*)scontext);
-				return -1;
-			}
-			else {
-				syslog(LOG_INFO,
-				       "CRON (%s) WARNING:"
-				       "Unauthorized exec context to SELINUX_ROLE_TYPE %s for user,"
-				       " but SELinux in permissive mode, continuing", 
-				       u->name, (char*)scontext);
-			}
-		}
-	}
-
-	if (setexeccon(scontext) < 0) { 
-		if (security_getenforce() > 0) {
-			syslog(LOG_ERR,
-			       "CRON (%s) ERROR:"
-			       "Could not set exec context to %s for user", 
-			       u->name, (char*)scontext);
-			return -1;
-		}
-	}
-#endif
-	return 0;
-}
-
 #ifdef WITH_SELINUX
 static int cron_change_selinux_range(user *u,security_context_t ucontext) {
 	if (is_selinux_enabled() <= 0)
-- 
2.40.0