diff options
Diffstat (limited to 'audit.c')
-rw-r--r-- | audit.c | 56 |
1 files changed, 28 insertions, 28 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: audit.c,v 1.1 2005/02/02 13:37:14 dtucker Exp $ */ | 1 | /* $Id: audit.c,v 1.2 2005/02/08 10:52:48 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2004, 2005 Darren Tucker. All rights reserved. | 4 | * Copyright (c) 2004, 2005 Darren Tucker. All rights reserved. |
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | 28 | ||
29 | #ifdef AUDIT_EVENTS | 29 | #ifdef SSH_AUDIT_EVENTS |
30 | 30 | ||
31 | #include "audit.h" | 31 | #include "audit.h" |
32 | #include "log.h" | 32 | #include "log.h" |
@@ -44,22 +44,22 @@ ssh_audit_event_t | |||
44 | audit_classify_auth(const char *method) | 44 | audit_classify_auth(const char *method) |
45 | { | 45 | { |
46 | if (strcmp(method, "none") == 0) | 46 | if (strcmp(method, "none") == 0) |
47 | return AUTH_FAIL_NONE; | 47 | return SSH_AUTH_FAIL_NONE; |
48 | else if (strcmp(method, "password") == 0) | 48 | else if (strcmp(method, "password") == 0) |
49 | return AUTH_FAIL_PASSWD; | 49 | return SSH_AUTH_FAIL_PASSWD; |
50 | else if (strcmp(method, "publickey") == 0 || | 50 | else if (strcmp(method, "publickey") == 0 || |
51 | strcmp(method, "rsa") == 0) | 51 | strcmp(method, "rsa") == 0) |
52 | return AUTH_FAIL_PUBKEY; | 52 | return SSH_AUTH_FAIL_PUBKEY; |
53 | else if (strncmp(method, "keyboard-interactive", 20) == 0 || | 53 | else if (strncmp(method, "keyboard-interactive", 20) == 0 || |
54 | strcmp(method, "challenge-response") == 0) | 54 | strcmp(method, "challenge-response") == 0) |
55 | return AUTH_FAIL_KBDINT; | 55 | return SSH_AUTH_FAIL_KBDINT; |
56 | else if (strcmp(method, "hostbased") == 0 || | 56 | else if (strcmp(method, "hostbased") == 0 || |
57 | strcmp(method, "rhosts-rsa") == 0) | 57 | strcmp(method, "rhosts-rsa") == 0) |
58 | return AUTH_FAIL_HOSTBASED; | 58 | return SSH_AUTH_FAIL_HOSTBASED; |
59 | else if (strcmp(method, "gssapi-with-mic") == 0) | 59 | else if (strcmp(method, "gssapi-with-mic") == 0) |
60 | return AUTH_FAIL_GSSAPI; | 60 | return SSH_AUTH_FAIL_GSSAPI; |
61 | else | 61 | else |
62 | return AUDIT_UNKNOWN; | 62 | return SSH_AUDIT_UNKNOWN; |
63 | } | 63 | } |
64 | 64 | ||
65 | /* helper to return supplied username */ | 65 | /* helper to return supplied username */ |
@@ -84,32 +84,32 @@ audit_event_lookup(ssh_audit_event_t ev) | |||
84 | ssh_audit_event_t event; | 84 | ssh_audit_event_t event; |
85 | const char *name; | 85 | const char *name; |
86 | } event_lookup[] = { | 86 | } event_lookup[] = { |
87 | {LOGIN_EXCEED_MAXTRIES, "LOGIN_EXCEED_MAXTRIES"}, | 87 | {SSH_LOGIN_EXCEED_MAXTRIES, "LOGIN_EXCEED_MAXTRIES"}, |
88 | {LOGIN_ROOT_DENIED, "LOGIN_ROOT_DENIED"}, | 88 | {SSH_LOGIN_ROOT_DENIED, "LOGIN_ROOT_DENIED"}, |
89 | {AUTH_SUCCESS, "AUTH_SUCCESS"}, | 89 | {SSH_AUTH_SUCCESS, "AUTH_SUCCESS"}, |
90 | {AUTH_FAIL_NONE, "AUTH_FAIL_NONE"}, | 90 | {SSH_AUTH_FAIL_NONE, "AUTH_FAIL_NONE"}, |
91 | {AUTH_FAIL_PASSWD, "AUTH_FAIL_PASSWD"}, | 91 | {SSH_AUTH_FAIL_PASSWD, "AUTH_FAIL_PASSWD"}, |
92 | {AUTH_FAIL_KBDINT, "AUTH_FAIL_KBDINT"}, | 92 | {SSH_AUTH_FAIL_KBDINT, "AUTH_FAIL_KBDINT"}, |
93 | {AUTH_FAIL_PUBKEY, "AUTH_FAIL_PUBKEY"}, | 93 | {SSH_AUTH_FAIL_PUBKEY, "AUTH_FAIL_PUBKEY"}, |
94 | {AUTH_FAIL_HOSTBASED, "AUTH_FAIL_HOSTBASED"}, | 94 | {SSH_AUTH_FAIL_HOSTBASED, "AUTH_FAIL_HOSTBASED"}, |
95 | {AUTH_FAIL_GSSAPI, "AUTH_FAIL_GSSAPI"}, | 95 | {SSH_AUTH_FAIL_GSSAPI, "AUTH_FAIL_GSSAPI"}, |
96 | {INVALID_USER, "INVALID_USER"}, | 96 | {SSH_INVALID_USER, "INVALID_USER"}, |
97 | {NOLOGIN, "NOLOGIN"}, | 97 | {SSH_NOLOGIN, "NOLOGIN"}, |
98 | {CONNECTION_CLOSE, "CONNECTION_CLOSE"}, | 98 | {SSH_CONNECTION_CLOSE, "CONNECTION_CLOSE"}, |
99 | {CONNECTION_ABANDON, "CONNECTION_ABANDON"}, | 99 | {SSH_CONNECTION_ABANDON, "CONNECTION_ABANDON"}, |
100 | {AUDIT_UNKNOWN, "AUDIT_UNKNOWN"} | 100 | {SSH_AUDIT_UNKNOWN, "AUDIT_UNKNOWN"} |
101 | }; | 101 | }; |
102 | 102 | ||
103 | for (i = 0; event_lookup[i].event != AUDIT_UNKNOWN; i++) | 103 | for (i = 0; event_lookup[i].event != SSH_AUDIT_UNKNOWN; i++) |
104 | if (event_lookup[i].event == ev) | 104 | if (event_lookup[i].event == ev) |
105 | break; | 105 | break; |
106 | return(event_lookup[i].name); | 106 | return(event_lookup[i].name); |
107 | } | 107 | } |
108 | 108 | ||
109 | # ifndef CUSTOM_AUDIT_EVENTS | 109 | # ifndef CUSTOM_SSH_AUDIT_EVENTS |
110 | /* | 110 | /* |
111 | * Null implementations of audit functions. | 111 | * Null implementations of audit functions. |
112 | * These get used if AUDIT_EVENTS is defined but no audit module is enabled. | 112 | * These get used if SSH_AUDIT_EVENTS is defined but no audit module is enabled. |
113 | */ | 113 | */ |
114 | 114 | ||
115 | /* | 115 | /* |
@@ -177,5 +177,5 @@ audit_run_command(const char *command) | |||
177 | debug("audit run command euid %d user %s command '%.200s'", geteuid(), | 177 | debug("audit run command euid %d user %s command '%.200s'", geteuid(), |
178 | audit_username(), command); | 178 | audit_username(), command); |
179 | } | 179 | } |
180 | # endif /* !defined CUSTOM_AUDIT_EVENTS */ | 180 | # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ |
181 | #endif /* AUDIT_EVENTS */ | 181 | #endif /* SSH_AUDIT_EVENTS */ |