Add --with-goodpri and --with-badpri configure options to specify the
syslog priority to use.
This commit is contained in:
10
INSTALL
10
INSTALL
@@ -196,6 +196,16 @@ Special features/options:
|
||||
found in /usr/include/syslog.h. The default is to use LOG_LOCAL2 but
|
||||
some sites may wish to use LOG_AUTH instead.
|
||||
|
||||
--with-goodpri=PRIORITY
|
||||
Determines which syslog priority to log successfully authenticated
|
||||
commands. A list of possible values may be found in
|
||||
/usr/include/syslog.h. The default is LOG_NOTICE.
|
||||
|
||||
--with-badpri=PRIORITY
|
||||
Determines which syslog priority to log unauthenticated commands
|
||||
and errors. A list of possible values may be found in
|
||||
/usr/include/syslog.h. The default is LOG_ALERT.
|
||||
|
||||
--with-logpath=path
|
||||
Override the default location of the sudo log file and use "path"
|
||||
instead. By default will use /var/log/sudo.log if there is a /var/log
|
||||
|
28
configure.in
28
configure.in
@@ -369,6 +369,34 @@ AC_ARG_WITH(logfac, [ --with-logfac syslog facility to log with (defa
|
||||
;;
|
||||
esac], [AC_DEFINE(LOGFAC, LOG_LOCAL2) AC_MSG_RESULT(LOG_LOCAL2)])
|
||||
|
||||
AC_MSG_CHECKING(at which syslog priority to log commands)
|
||||
AC_ARG_WITH(goodpri, [ --with-goodpri syslog priority for commands (def is LOG_NOTICE)],
|
||||
[case $with_goodpri in
|
||||
yes) echo "Must give --with-goodpri an argument."
|
||||
exit 1
|
||||
;;
|
||||
no) echo "Sorry, --without-goodpri not supported."
|
||||
exit 1
|
||||
;;
|
||||
*) AC_DEFINE_UNQUOTED(LOGFAC, $with_goodpri)
|
||||
AC_MSG_RESULT([$with_goodpri])
|
||||
;;
|
||||
esac], [AC_DEFINE(PRI_SUCCESS, LOG_NOTICE) AC_MSG_RESULT(LOG_NOTICE)])
|
||||
|
||||
AC_MSG_CHECKING(at which syslog priority to log failures)
|
||||
AC_ARG_WITH(badpri, [ --with-badpri syslog priority for failures (def is LOG_ALERT)],
|
||||
[case $with_badpri in
|
||||
yes) echo "Must give --with-badpri an argument."
|
||||
exit 1
|
||||
;;
|
||||
no) echo "Sorry, --without-badpri not supported."
|
||||
exit 1
|
||||
;;
|
||||
*) AC_DEFINE_UNQUOTED(LOGFAC, $with_badpri)
|
||||
AC_MSG_RESULT([$with_badpri])
|
||||
;;
|
||||
esac], [AC_DEFINE(PRI_FAILURE, LOG_ALERT) AC_MSG_RESULT(LOG_ALERT)])
|
||||
|
||||
AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file],
|
||||
[case $with_logpath in
|
||||
yes) echo "Must give --with-logpath an argument."
|
||||
|
24
logging.h
24
logging.h
@@ -41,6 +41,15 @@
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
/* Logging types */
|
||||
#define SLOG_SYSLOG 0x01
|
||||
#define SLOG_FILE 0x02
|
||||
#define SLOG_BOTH 0x03
|
||||
|
||||
#if (LOGGING & SLOG_SYSLOG)
|
||||
# include <syslog.h>
|
||||
#endif
|
||||
|
||||
/* Flags for log_error() */
|
||||
#define MSG_ONLY 0x01
|
||||
#define USE_ERRNO 0x02
|
||||
@@ -57,21 +66,6 @@
|
||||
# define MAXSYSLOGLEN 960
|
||||
#endif
|
||||
|
||||
/*
|
||||
* syslog(3) parameters
|
||||
*/
|
||||
|
||||
#define SLOG_SYSLOG 0x01
|
||||
#define SLOG_FILE 0x02
|
||||
#define SLOG_BOTH 0x03
|
||||
|
||||
/* XXX - PRI_SUCCESS and PRI_FAILURE should be configure options */
|
||||
#if (LOGGING & SLOG_SYSLOG)
|
||||
# include <syslog.h>
|
||||
# define PRI_SUCCESS LOG_NOTICE
|
||||
# define PRI_FAILURE LOG_ALERT
|
||||
#endif /* LOGGING & SLOG_SYSLOG */
|
||||
|
||||
void log_auth __P((int, int));
|
||||
void log_error __P((int flags, const char *fmt, ...));
|
||||
RETSIGTYPE reapchild __P((int));
|
||||
|
Reference in New Issue
Block a user