~ubuntu-branches/ubuntu/oneiric/sudo/oneiric-security

« back to all changes in this revision

Viewing changes to bsm_audit.c

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks
  • Date: 2012-05-15 23:28:04 UTC
  • Revision ID: package-import@ubuntu.com-20120515232804-2rd0d4k222la647h
Tags: 1.7.4p6-1ubuntu2.1
* SECURITY UPDATE: Properly handle multiple netmasks in sudoers Host and
  Host_List values
  - debian/patches/CVE-2012-2337.patch: Don't perform IPv6 checks on IPv4
    addresses. Based on upstream patch.
  - CVE-2012-2337

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
#include "bsm_audit.h"
33
33
 
 
34
/*
 
35
 * Solaris auditon() returns EINVAL if BSM audit not configured.
 
36
 * OpenBSM returns ENOSYS for unimplemented options.
 
37
 */
 
38
#ifdef __sun__
 
39
# define AUDIT_NOT_CONFIGURED   EINVAL
 
40
#else
 
41
# define AUDIT_NOT_CONFIGURED   ENOSYS
 
42
#endif
 
43
 
34
44
void log_error(int flags, const char *fmt, ...) __attribute__((__noreturn__));
35
45
 
36
46
static int
71
81
         * If we are not auditing, don't cut an audit record; just return.
72
82
         */
73
83
        if (auditon(A_GETCOND, (caddr_t)&au_cond, sizeof(long)) < 0) {
74
 
                if (errno == ENOSYS)
 
84
                if (errno == AUDIT_NOT_CONFIGURED)
75
85
                        return;
76
86
                log_error(0, "Could not determine audit condition");
77
87
        }
132
142
         * If we are not auditing, don't cut an audit record; just return.
133
143
         */
134
144
        if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
135
 
                if (errno == ENOSYS)
 
145
                if (errno == AUDIT_NOT_CONFIGURED)
136
146
                        return;
137
147
                log_error(0, "Could not determine audit condition");
138
148
        }