~ubuntu-branches/ubuntu/quantal/sudo/quantal

« back to all changes in this revision

Viewing changes to plugins/sudoers/logging.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2011-11-20 12:07:45 UTC
  • mfrom: (1.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20111120120745-o3qpklobmygytndc
Tags: 1.8.3p1-1ubuntu1
* Merge from debian/testing, remaining changes:
  - debian/patches/keep_home_by_default.patch:
    + Set HOME in initial_keepenv_table. (rebased for 1.8.3p1)
  - debian/patches/enable_badpass.patch: turn on "mail_badpass" by default:
    + attempting sudo without knowing a login password is as bad as not
      being listed in the sudoers file, especially if getting the password
      wrong means doing the access-check-email-notification never happens
      (rebased for 1.8.3p1)
  - debian/rules:
    + compile with --without-lecture --with-tty-tickets (Ubuntu specific)
    + install man/man8/sudo_root.8 (Ubuntu specific)
    + install apport hooks
    + The ubuntu-sudo-as-admin-successful.patch was taken upstream by
      Debian however it requires a --enable-admin-flag configure flag to
      actually enable it.
  - debian/sudoers: 
    + grant admin group sudo access
  - debian/sudo-ldap.dirs, debian/sudo.dirs: 
    + add usr/share/apport/package-hooks
  - debian/sudo.preinst:
    + avoid conffile prompt by checking for known default /etc/sudoers
      and if found installing the correct default /etc/sudoers file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1999-2005, 2009-2010
 
3
 *      Todd C. Miller <Todd.Miller@courtesan.com>
 
4
 *
 
5
 * Permission to use, copy, modify, and distribute this software for any
 
6
 * purpose with or without fee is hereby granted, provided that the above
 
7
 * copyright notice and this permission notice appear in all copies.
 
8
 *
 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 
10
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 
11
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 
12
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
13
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 
14
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 
15
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
16
 */
 
17
 
 
18
#ifndef _LOGGING_H
 
19
#define _LOGGING_H
 
20
 
 
21
#include <syslog.h>
 
22
#ifdef __STDC__
 
23
# include <stdarg.h>
 
24
#else
 
25
# include <varargs.h>
 
26
#endif
 
27
 
 
28
/* Logging types */
 
29
#define SLOG_SYSLOG             0x01
 
30
#define SLOG_FILE               0x02
 
31
#define SLOG_BOTH               0x03
 
32
 
 
33
/* Flags for log_error() */
 
34
#define MSG_ONLY                0x01
 
35
#define USE_ERRNO               0x02
 
36
#define NO_MAIL                 0x04
 
37
#define NO_EXIT                 0x08
 
38
#define NO_STDERR               0x10
 
39
 
 
40
/*
 
41
 * Maximum number of characters to log per entry.  The syslogger
 
42
 * will log this much, after that, it truncates the log line.
 
43
 * We need this here to make sure that we continue with another
 
44
 * syslog(3) call if the internal buffer is more than 1023 characters.
 
45
 */
 
46
#ifndef MAXSYSLOGLEN
 
47
# define MAXSYSLOGLEN           960
 
48
#endif
 
49
 
 
50
/*
 
51
 * Indentation level for file-based logs when word wrap is enabled.
 
52
 */
 
53
#define LOG_INDENT      "    "
 
54
 
 
55
void audit_success(char *[]);
 
56
void audit_failure(char *[], char const * const, ...);
 
57
void log_allowed(int);
 
58
void log_denial(int, int);
 
59
void log_error(int flags, const char *fmt, ...) __printflike(2, 3);
 
60
void reapchild(int);
 
61
void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen);
 
62
 
 
63
#endif /* _LOGGING_H */