]> granicus.if.org Git - cronie/commitdiff
Remove unused function.
authorMarcela <marca@caladan.englab.brq.redhat.com>
Tue, 27 May 2008 11:58:04 +0000 (13:58 +0200)
committerMarcela <marca@caladan.englab.brq.redhat.com>
Tue, 27 May 2008 11:58:04 +0000 (13:58 +0200)
src/funcs.h
src/security.c

index bc82639ac350aa6c0028211b15015af27689c4dc..b3b1cda841fcec6aecda893837fa806c6c0d9dcb 100644 (file)
@@ -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, 
index cdcc14b6009a898c40b001edd3e423881b93ea2f..2c20f90e3f8900c9ab36dbd6624f41733bf42531 100644 (file)
@@ -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)