--- audit-1.6.2.orig/docs/auditd.8 +++ audit-1.6.2/docs/auditd.8 @@ -3,7 +3,7 @@ auditd \- The Linux Audit daemon .SH SYNOPSIS .B auditd -.RB [ \-f ]\ [ \-l ]\ [ \-n ] +.RB [ \-f ]\ [ \-l ]\ [ \-n ]\ [ \-s\ disable|enable|nochange ] .SH DESCRIPTION \fBauditd\fP is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk. Viewing the logs is done with the .B ausearch @@ -24,6 +24,9 @@ .TP .B \-n no fork. This is useful for running off of inittab +.TP +.B \-s=\fIENABLE_STATE\fR +specify when starting if auditd should change the current value for the kernel enabled flag. Valid values for ENABLE_STATE are "disable", "enable" or "nochange". The default is to enable (and disable when auditd terminates). The value of the enabled flag may be changed during the lifetime of auditd using 'auditctl -e'. .SH SIGNALS .TP SIGHUP --- audit-1.6.2.orig/src/auditd.c +++ audit-1.6.2/src/auditd.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "libaudit.h" #include "auditd-config.h" @@ -65,13 +66,19 @@ static void clean_exit(void); static int get_reply(int fd, struct audit_reply *rep, int seq); +enum startup_state {startup_disable=0, startup_enable, startup_nochange, startup_INVALID}; +static const char *startup_states[] = {"disable", "enable", "nochange"}; /* * Output a usage message */ static void usage(void) { - puts("Usage: auditd [ -f -l -n ]"); + fprintf(stderr, "Usage: auditd [-f] [-l] [-n] [-s %s|%s|%s]\n", + startup_states[startup_disable], + startup_states[startup_enable], + startup_states[startup_nochange]); + exit(2); } @@ -308,26 +315,56 @@ struct rlimit limit; int hup_info_requested = 0, usr1_info_requested = 0; int i; + int opt_foreground = 0, opt_allow_links = 0; + enum startup_state opt_startup = startup_enable; + int c; + extern char *optarg; + extern int optind; /* Get params && set mode */ - config.daemonize = D_BACKGROUND; - if (argc > 1) { - for (i=1; i 0) { struct audit_reply trep;