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
|
found in /usr/include/syslog.h. The default is to use LOG_LOCAL2 but
|
||||||
some sites may wish to use LOG_AUTH instead.
|
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
|
--with-logpath=path
|
||||||
Override the default location of the sudo log file and use "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
|
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)])
|
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],
|
AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file],
|
||||||
[case $with_logpath in
|
[case $with_logpath in
|
||||||
yes) echo "Must give --with-logpath an argument."
|
yes) echo "Must give --with-logpath an argument."
|
||||||
|
28
logging.h
28
logging.h
@@ -36,9 +36,18 @@
|
|||||||
#define _LOGGING_H
|
#define _LOGGING_H
|
||||||
|
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
#include <stdarg.h>
|
# include <stdarg.h>
|
||||||
#else
|
#else
|
||||||
#include <varargs.h>
|
# 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
|
#endif
|
||||||
|
|
||||||
/* Flags for log_error() */
|
/* Flags for log_error() */
|
||||||
@@ -57,21 +66,6 @@
|
|||||||
# define MAXSYSLOGLEN 960
|
# define MAXSYSLOGLEN 960
|
||||||
#endif
|
#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_auth __P((int, int));
|
||||||
void log_error __P((int flags, const char *fmt, ...));
|
void log_error __P((int flags, const char *fmt, ...));
|
||||||
RETSIGTYPE reapchild __P((int));
|
RETSIGTYPE reapchild __P((int));
|
||||||
|
Reference in New Issue
Block a user