2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 18:08:23 +00:00
sudo/plugins/sudoers/logging.h

58 lines
1.7 KiB
C
Raw Normal View History

1999-07-22 12:51:13 +00:00
/*
2009-05-25 12:02:42 +00:00
* Copyright (c) 1999-2005, 2009
2008-11-09 14:13:13 +00:00
* Todd C. Miller <Todd.Miller@courtesan.com>
1999-07-22 12:51:13 +00:00
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1999-07-22 12:51:13 +00:00
*/
#ifndef _LOGGING_H
#define _LOGGING_H
#include <syslog.h>
1999-07-22 12:51:13 +00:00
#ifdef __STDC__
# include <stdarg.h>
1999-07-22 12:51:13 +00:00
#else
# include <varargs.h>
#endif
/* Logging types */
#define SLOG_SYSLOG 0x01
#define SLOG_FILE 0x02
#define SLOG_BOTH 0x03
1999-07-22 12:51:13 +00:00
/* Flags for log_error() */
#define MSG_ONLY 0x01
#define USE_ERRNO 0x02
#define NO_MAIL 0x04
#define NO_EXIT 0x08
2004-10-26 22:20:18 +00:00
#define NO_STDERR 0x10
1999-07-22 12:51:13 +00:00
/*
* Maximum number of characters to log per entry. The syslogger
* will log this much, after that, it truncates the log line.
* We need this here to make sure that we continue with another
1999-07-22 12:51:13 +00:00
* syslog(3) call if the internal buffer is more than 1023 characters.
*/
#ifndef MAXSYSLOGLEN
# define MAXSYSLOGLEN 960
#endif
2010-03-17 19:56:27 -04:00
void audit_success(char **);
void audit_failure(char **, char const * const, ...);
void log_allowed(int);
void log_denial(int, int);
void log_error(int flags, const char *fmt, ...) __printflike(2, 3);
RETSIGTYPE reapchild(int);
1999-07-22 12:51:13 +00:00
#endif /* _LOGGING_H */