]> andersk Git - gssapi-openssh.git/blobdiff - openssh/audit-bsm.c
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / openssh / audit-bsm.c
index f8322459bdb3f93e2898f52f52334e6ad230dba1..41a8ed04c9e4f9f24e78182c9a2776b204128b2e 100644 (file)
 #include "includes.h"
 #if defined(USE_BSM_AUDIT)
 
-#include <sys/types.h>
-
-#include <errno.h>
-#include <netdb.h>
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-
 #include "ssh.h"
 #include "log.h"
-#include "key.h"
-#include "hostfile.h"
 #include "auth.h"
 #include "xmalloc.h"
 
@@ -64,6 +54,8 @@
 #if defined(HAVE_GETAUDIT_ADDR)
 #define        AuditInfoStruct         auditinfo_addr
 #define AuditInfoTermID                au_tid_addr_t
+#define GetAuditFunc(a,b)      getaudit_addr((a),(b))
+#define GetAuditFuncText       "getaudit_addr"
 #define SetAuditFunc(a,b)      setaudit_addr((a),(b))
 #define SetAuditFuncText       "setaudit_addr"
 #define AUToSubjectFunc                au_to_subject_ex
 #else
 #define        AuditInfoStruct         auditinfo
 #define AuditInfoTermID                au_tid_t
+#define GetAuditFunc(a,b)      getaudit(a)
+#define GetAuditFuncText       "getaudit"
 #define SetAuditFunc(a,b)      setaudit(a)
 #define SetAuditFuncText       "setaudit"
 #define AUToSubjectFunc                au_to_subject
 #define AUToReturnFunc(a,b)    au_to_return((a), (u_int)(b))
 #endif
 
-#ifndef cannot_audit
 extern int     cannot_audit(int);
-#endif
 extern void    aug_init(void);
+extern dev_t   aug_get_port(void);
+extern int     aug_get_machine(char *, u_int32_t *, u_int32_t *);
 extern void    aug_save_auid(au_id_t);
 extern void    aug_save_uid(uid_t);
 extern void    aug_save_euid(uid_t);
@@ -116,51 +110,6 @@ static AuditInfoTermID ssh_bsm_tid;
 
 /* Below is the low-level BSM interface code */
 
-/*
- * aug_get_machine is only required on IPv6 capable machines, we use a
- * different mechanism in audit_connection_from() for IPv4-only machines.
- * getaudit_addr() is only present on IPv6 capable machines.
- */
-#if defined(HAVE_AUG_GET_MACHINE) || !defined(HAVE_GETAUDIT_ADDR)
-extern int     aug_get_machine(char *, u_int32_t *, u_int32_t *);
-#else
-static int
-aug_get_machine(char *host, u_int32_t *addr, u_int32_t *type)
-{
-       struct addrinfo *ai; 
-       struct sockaddr_in *in4;
-       struct sockaddr_in6 *in6;
-       int ret = 0, r;
-
-       if ((r = getaddrinfo(host, NULL, NULL, &ai)) != 0) {
-               error("BSM audit: getaddrinfo failed for %.100s: %.100s", host,
-                   r == EAI_SYSTEM ? strerror(errno) : gai_strerror(r));
-               return -1;
-       }
-       
-       switch (ai->ai_family) {
-       case AF_INET:
-               in4 = (struct sockaddr_in *)ai->ai_addr;
-               *type = AU_IPv4;
-               memcpy(addr, &in4->sin_addr, sizeof(struct in_addr));
-               break;
-#ifdef AU_IPv6
-       case AF_INET6: 
-               in6 = (struct sockaddr_in6 *)ai->ai_addr;
-               *type = AU_IPv6;
-               memcpy(addr, &in6->sin6_addr, sizeof(struct in6_addr));
-               break;
-#endif
-       default:
-               error("BSM audit: unknown address family for %.100s: %d",
-                   host, ai->ai_family);
-               ret = -1;
-       }
-       freeaddrinfo(ai);
-       return ret;
-}
-#endif
-
 /*
  * Check if the specified event is selected (enabled) for auditing.
  * Returns 1 if the event is selected, 0 if not and -1 on failure.
This page took 0.044084 seconds and 4 git commands to generate.