![]()
|
diff -u -udbNpr openbsd-compat/bsd-solaris.c /openbsd-compat/bsd-solaris.c
--- openbsd-compat/bsd-solaris.c 2004-10-26 16:29:19.000000000 -0700
+++ /openbsd-compat/bsd-solaris.c 2004-10-26 16:31:01.000000000 -0700
@@ -28,11 +28,15 @@
#include "includes.h"
#if defined(HAVE_BSM_AUDIT_H) && defined(HAVE_LIBBSM)
+#if !defined(__APPLE__)
#include <sys/systeminfo.h>
+#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
+#if !defined(__APPLE__)
#include <sys/systeminfo.h>
+#endif
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
@@ -40,7 +44,9 @@
#include <signal.h>
#include <pwd.h>
+#if !defined(__APPLE__)
#include <shadow.h>
+#endif
#include <utmpx.h>
#include <unistd.h>
#include <string.h>
@@ -83,7 +89,11 @@ static int selected(char *nam, uid_t uid
static void get_terminal_id(AuditInfoTermID *tid);
+#if !defined(__APPLE__)
extern int cannot_audit(int);
+#else
+#define gettext(x) (x)
+#endif
extern void aug_init(void);
extern dev_t aug_get_port(void);
extern int aug_get_machine(char *, uint32_t *, uint32_t *);
@@ -137,7 +147,7 @@ void
solaris_audit_save_host(const char *host)
{
int i;
-#if !defined(HAVE_GETAUDIT_ADDR)
+#if defined(__APPLE__) || !defined(HAVE_GETAUDIT_ADDR)
in_addr_t ia;
#endif
@@ -147,7 +157,7 @@ solaris_audit_save_host(const char *host
(void) strlcpy(sav_host, host, sizeof (sav_host));
debug3("BSM audit: sav_host=%s", sav_host);
memset(sav_machine, 0, sizeof(sav_machine));
-#if defined(HAVE_GETAUDIT_ADDR)
+#if !defined(__APPLE__) && defined(HAVE_GETAUDIT_ADDR)
(void) aug_get_machine(sav_host, &sav_machine[0], &sav_iptype);
debug3("BSM audit: sav_iptype=%ld", (long)sav_iptype);
#else
@@ -395,7 +405,10 @@ solaris_audit_session_setup(void)
static void
get_terminal_id(AuditInfoTermID *tid)
{
-#if defined(HAVE_GETAUDIT_ADDR)
+#if defined(__APPLE__)
+ if(kAUBadParamErr == audit_set_terminal_id(tid))
+ debug("BSM get_terminal_id: error");
+#elif defined(HAVE_GETAUDIT_ADDR)
tid->at_port = sav_port;
tid->at_type = sav_iptype;
tid->at_addr[0] = sav_machine[0];
syntax highlighted by Code2HTML, v. 0.9.1 |