From 646bff1e34880828037f9223c233a5a99ce379c2 Mon Sep 17 00:00:00 2001 From: mmaslano Date: Fri, 17 Aug 2007 15:13:09 +0200 Subject: [PATCH] Now is cron with audit. Complaining about denying users. --- Makefile | 4 ++-- misc.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b118376..724fcb6 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ DESTETC = $(DESTROOT)/../etc INCLUDE = -I. #INCLUDE = #<> -LIBS = -lselinux -lpam -lpam_misc +LIBS = -lselinux -lpam -lpam_misc -laudit #<> #CDEBUG = -O #CDEBUG = -g @@ -70,7 +70,7 @@ LINTFLAGS = -hbxa $(INCLUDE) $(DEBUGGING) #<> CC = gcc -Wall -Wno-unused -Wno-comment #<> -DEFS = -DWITH_SELINUX -DWITH_PAM +DEFS = -DWITH_SELINUX -DWITH_PAM -DWITH_AUDIT #(SGI IRIX systems need this) #DEFS = -D_BSD_SIGNALS -Dconst= #<> diff --git a/misc.c b/misc.c index a4ce5e5..fc60b93 100644 --- a/misc.c +++ b/misc.c @@ -29,6 +29,9 @@ static char rcsid[] = "$Id: misc.c,v 1.16 2004/01/23 18:56:43 vixie Exp $"; #include "cron.h" #include +#ifdef WITH_AUDIT +#include +#endif #if defined(SYSLOG) && defined(LOG_FILE) # undef LOG_FILE @@ -487,6 +490,14 @@ allowed(const char *username, const char *allow_file, const char *deny_file) { isallowed = TRUE; } } +#ifdef WITH_AUDIT + if (isallowed == FALSE) { + int audit_fd = audit_open(); + audit_log_user_message(audit_fd, AUDIT_USER_START, "cron deny", + NULL, NULL, NULL, 0); + close(audit_fd); + } +#endif return (isallowed); } -- 2.40.0