1 --- hpn-ssh-hpn-18.4.2/INSTALL.orig
2 +++ hpn-ssh-hpn-18.4.2/INSTALL
5 Basic Security Module (BSM):
7 -Native BSM support is known to exist in Solaris from at least 2.5.1,
8 -FreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM
9 -implementation (http://www.openbsm.org).
10 +Native BSM support is known to exist in Solaris from at least 2.5.1
11 +to Solaris 10. From Solaris 11 the previously documented BSM (libbsm)
12 +interfaces are no longer public and are unsupported. While not public
13 +interfaces, audit-solaris.c implements Solaris Audit from Solaris 11.
14 +Native BSM support is known to exist in FreeBSD 6.1 and OS X.
15 +Alternatively, you may use the OpenBSM implementation
16 +(http://www.openbsm.org).
21 There are a few other options to the configure script:
23 --with-audit=[module] enable additional auditing via the specified module.
24 -Currently, drivers for "debug" (additional info via syslog) and "bsm"
25 -(Sun's Basic Security Module) are supported.
26 +Currently, drivers for "debug" (additional info via syslog), and "bsm"
27 +(Sun's Legacy Basic Security Module prior to Solaris 11), and "solaris"
28 +(Sun's Audit infrastructure from Solaris 11) are supported.
30 --with-pam enables PAM support. If PAM support is compiled in, it must
31 also be enabled in sshd_config (refer to the UsePAM directive).
32 --- hpn-ssh-hpn-18.4.2/Makefile.in.orig
33 +++ hpn-ssh-hpn-18.4.2/Makefile.in
35 sshconnect.o sshconnect2.o mux.o cipher-switch.o $(SKOBJS)
37 SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o \
38 - audit.o audit-bsm.o audit-linux.o platform.o \
39 + audit.o audit-bsm.o audit-linux.o audit-solaris.o platform.o \
40 sshpty.o sshlogin.o servconf.o serverloop.o \
41 auth.o auth2.o auth-options.o session.o \
42 auth2-chall.o groupaccess.o \
43 --- hpn-ssh-hpn-18.4.2/README.platform.orig
44 +++ hpn-ssh-hpn-18.4.2/README.platform
46 libssl-dev, libz-dev and libpam-dev.
51 -If you enable BSM auditing on Solaris, you need to update audit_event(4)
52 -for praudit(1m) to give sensible output. The following line needs to be
55 +If you enable BSM auditing on Solaris, you need to update audit_event(5)
56 +for praudit(8) to give sensible output. The following line needs to be
57 added to /etc/security/audit_event:
59 32800:AUE_openssh:OpenSSH login:lo
61 number is already in use on your system, you may change it at build time
62 by configure'ing --with-cflags=-DAUE_openssh=32801 then rebuilding.
66 +Solaris Audit is supported by configuring --with-audit=solaris.
70 --- hpn-ssh-hpn-18.4.2/audit-bsm.c.orig
71 +++ hpn-ssh-hpn-18.4.2/audit-bsm.c
73 /* Below is the sshd audit API code */
76 -audit_connection_from(const char *host, int port)
77 +audit_connection_from(struct ssh *ssh, const char *host, int port)
79 AuditInfoTermID *tid = &ssh_bsm_tid;
81 --- hpn-ssh-hpn-18.4.2/audit-linux.c.orig
82 +++ hpn-ssh-hpn-18.4.2/audit-linux.c
84 /* Below is the sshd audit API code */
87 -audit_connection_from(const char *host, int port)
88 +audit_connection_from(struct ssh *ssh, const char *host, int port)
93 +++ hpn-ssh-hpn-18.4.2/audit-solaris.c
98 + * The contents of this file are subject to the terms of the
99 + * Common Development and Distribution License (the "License").
100 + * You may not use this file except in compliance with the License.
102 + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
103 + * or http://www.opensolaris.org/os/licensing.
104 + * See the License for the specific language governing permissions
105 + * and limitations under the License.
107 + * When distributing Covered Code, include this CDDL HEADER in each
108 + * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
109 + * If applicable, add the following below this CDDL HEADER, with the
110 + * fields enclosed by brackets "[]" replaced with your own identifying
111 + * information: Portions Copyright [yyyy] [name of copyright owner]
117 + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
120 +#include "includes.h"
121 +#if defined(USE_SOLARIS_AUDIT)
126 +#include "hostfile.h"
135 +#include <bsm/adt.h>
136 +#include <bsm/adt_event.h>
139 +#include <bsm/audit.h>
140 +#include <arpa/inet.h>
141 +#include <netinet/in.h>
152 +#include <bsm/adt.h>
153 +#include <bsm/audit.h>
155 +#include <sys/types.h>
156 +#include <sys/stat.h>
158 +/* semi private adt functions to extract information */
160 +extern void adt_get_asid(const adt_session_data_t *, au_asid_t *);
161 +extern void adt_get_auid(const adt_session_data_t *, au_id_t *);
162 +extern void adt_get_mask(const adt_session_data_t *, au_mask_t *);
163 +extern void adt_get_termid(const adt_session_data_t *, au_tid_addr_t *);
165 +extern void __auditd_debug(char *, ...);
168 +__audit_pidinfo(void)
170 + adt_session_data_t *ah = NULL;
172 + char *auid_name = "badname";
173 + struct passwd *pwd;
178 + char pbuf[INET6_ADDRSTRLEN];
183 + if (adt_start_session(&ah, NULL, ADT_USE_PROC_DATA) != 0) {
184 + __auditd_debug("cannot start session %s\n", strerror(errno));
188 + __auditd_debug("ah is NULL\n");
191 + adt_get_auid(ah, &auid);
192 + if ((pwd = getpwuid((uid_t)auid)) != NULL) {
193 + auid_name = pwd->pw_name;
195 + __auditd_debug("audit id = %s(%d)\n", auid_name, auid);
197 + adt_get_mask(ah, &mask);
198 + if (getauditflagschar(flags, &mask, NULL) < 0) {
199 + (void) strlcpy(flags, "badflags", sizeof (flags));
202 + __auditd_debug("preselection mask = %s(0x%lx,0x%lx)\n", flags,
203 + mask.am_success, mask.am_failure);
205 + __auditd_debug("preselection mask = %s(0x%llx,0x%llx)\n", flags,
206 + mask.am_success, mask.am_failure);
209 + adt_get_termid(ah, &tid);
210 + __auditd_debug("tid type=%d, maj=%u, min=%u, addr=%x:%x:%x:%x\n",
212 + (uint16_t)((tid.at_port) >> BITS(uint16_t)),
213 + (uint16_t)(tid.at_port & UINT16_MAX),
218 + if (tid.at_type == AU_IPv6) {
221 + (void) inet_ntop(af, (void *)(tid.at_addr), pbuf,
223 + remote = (tid.at_port >> BITS(uint16_t));
224 + local = (tid.at_port & UINT16_MAX);
225 + __auditd_debug("tid type-%d (remote,local,host)= %u,%u,%s\n",
226 + tid.at_type, remote, local, pbuf);
227 + adt_get_asid(ah, &asid);
228 + __auditd_debug("audit session id = %u\n", asid);
229 + (void) adt_end_session(ah);
231 +#else /* !ADT_DEBUG */
235 +__auditd_debug(char *fmt, ...)
242 +#endif /* ADT_DEBUG */
244 +#include <security/pam_appl.h>
246 +#include <sys/types.h>
248 +extern Authctxt *the_authctxt;
250 +extern const char *audit_username(void);
251 +extern const char *audit_event_lookup(ssh_audit_event_t);
253 +static adt_session_data_t *ah = NULL; /* audit session handle */
254 +static adt_termid_t *tid = NULL; /* peer terminal id */
256 +static void audit_login(void);
257 +static void audit_logout(void);
258 +static void audit_fail(int);
260 +/* Below is the sshd audit API Solaris adt interpretation */
263 + * Called after a connection has been accepted but before any authentication
264 + * has been attempted.
268 +audit_connection_from(struct ssh *ssh, const char *host, int port)
270 + int peer = ssh_packet_get_connection_in(ssh);
271 + adt_session_data_t *ah = NULL;
273 + if (adt_load_termid(peer, &tid) != 0) {
274 + error("adt audit_connection_from: unable to load tid for %d:%s",
275 + peer, strerror(errno));
278 + if (adt_start_session(&ah, NULL, 0) != 0) {
279 + error("adt audit_connection_from: unable to start session "
280 + "for %s:%d:%s", host, port, strerror(errno));
283 + if (adt_set_user(ah, ADT_NO_AUDIT, ADT_NO_AUDIT, 0,
284 + ADT_NO_AUDIT, tid, ADT_SETTID) != 0) {
285 + error("adt audit_connection_from: unable to set user "
286 + "for %s:%d:%s", host, port, strerror(errno));
289 + if (adt_set_proc(ah) != 0) {
290 + error("adt audit_connection_from: unable to set proc "
291 + "for %s:%d:%s", host, port, strerror(errno));
294 + (void) adt_end_session(ah);
295 + debug("adt audit_connection_from(%s, %d): peerfd=%d", host, port,
297 + __auditd_debug("%d/%d:%d-adt audit_connection_from(%s, %d)ctxt=%p: "
298 + "peerfd=%d\n", getpid(), getuid(), geteuid(), host, port,
299 + (void *)the_authctxt, peer);
307 + (void) adt_end_session(ah);
312 + * Called when various events occur (see audit.h for a list of possible
313 + * events and what they mean).
315 + * Entry the_authcntxt
318 +audit_event(struct ssh *ssh, ssh_audit_event_t event)
320 + static boolean_t logged_in = B_FALSE; /* if user did login */
321 + int fail = PAM_IGNORE; /* default unset */
322 + static boolean_t did_maxtries = B_FALSE; /* if interactive and abort */
324 + debug("adt audit_event(%s)", audit_event_lookup(event));
325 + __auditd_debug("%d/%d:%d-adt audit_event(%s/%s)ctxt=%p\n",
326 + getpid(), getuid(), geteuid(), audit_event_lookup(event),
327 + audit_username(), (void *)the_authctxt);
331 + case SSH_AUTH_SUCCESS: /* authentication success */
332 + logged_in = B_TRUE;
333 + audit_login(); /* ADT_ssh; */
336 + case SSH_CONNECTION_CLOSE: /* connection closed, all done */
338 + audit_logout(); /* ADT_logout; */
339 + logged_in = B_FALSE;
341 + error("adt audit_event logout without login");
347 + /* Translate fail events to Solaris PAM errors */
349 + /* auth2.c: userauth_finish as audit_event(SSH_LOGIN_EXCEED_MAXTRIES) */
350 + /* auth1.c:do_authloop audit_event(SSH_LOGIN_EXCEED_MAXTRIES) */
351 + case SSH_LOGIN_EXCEED_MAXTRIES:
352 + fail = PAM_MAXTRIES;
353 + did_maxtries = B_TRUE;
356 + /* auth2.c: userauth_finish as audit_event(SSH_LOGIN_ROOT_DENIED) */
357 + /* auth1.c:do_authloop audit_event(SSH_LOGIN_ROOT_DENIED) */
358 + case SSH_LOGIN_ROOT_DENIED:
359 + fail = PAM_PERM_DENIED;
362 + /* auth2.c: input_userauth_request as audit_event(SSH_INVALID_USER) */
363 + /* auth.c: getpwnamallow as audit_event(SSH_INVALID_USER) */
364 + case SSH_INVALID_USER:
365 + fail = PAM_USER_UNKNOWN;
368 + /* seems unused, but translate to the Solaris PAM error */
370 + fail = PAM_ACCT_EXPIRED;
374 + * auth.c in auth_log as it's walking through methods calls
375 + * audit_classify_method(method) which maps
377 + * none -> SSH_AUTH_FAIL_NONE
378 + * password -> SSH_AUTH_FAIL_PASSWD
380 + * publickey -> SSH_AUTH_FAIL_PUBKEY
381 + * rsa -> SSH_AUTH_FAIL_PUBKEY
383 + * keyboard-interactive -> SSH_AUTH_FAIL_KBDINT
384 + * challenge-response -> SSH_AUTH_FAIL_KBDINT
386 + * hostbased -> SSH_AUTH_FAIL_HOSTBASED
387 + * rhosts-rsa -> SSH_AUTH_FAIL_HOSTBASED
389 + * gssapi-with-mic -> SSH_AUTH_FAIL_GSSAPI
391 + * unknown method -> SSH_AUDIT_UNKNOWN
394 + * see mon_table mon_dispatch_proto20[], mon_dispatch_postauth20[],
395 + * mon_dispatch_proto15[], mon_dispatch_postauth15[]:
396 + * MONITOR_REQ_AUDIT_EVENT
397 + * called from monitor.c:mm_answer_audit_event()
398 + * SSH_AUTH_FAIL_PUBKEY, SSH_AUTH_FAIL_HOSTBASED,
399 + * SSH_AUTH_FAIL_GSSAPI, SSH_LOGIN_EXCEED_MAXTRIES,
400 + * SSH_LOGIN_ROOT_DENIED, SSH_CONNECTION_CLOSE SSH_INVALID_USER
401 + * monitor_wrap.c: mm_audit_event()
403 + case SSH_AUTH_FAIL_NONE: /* auth type none */
404 + case SSH_AUTH_FAIL_PUBKEY: /* authtype publickey */
407 + case SSH_AUTH_FAIL_PASSWD: /* auth type password */
408 + case SSH_AUTH_FAIL_KBDINT: /* authtype keyboard-interactive */
409 + case SSH_AUTH_FAIL_HOSTBASED: /* auth type hostbased */
410 + case SSH_AUTH_FAIL_GSSAPI: /* auth type gssapi-with-mic */
411 + case SSH_AUDIT_UNKNOWN: /* auth type unknown */
412 + fail = PAM_AUTH_ERR;
415 + /* sshd.c: cleanup_exit: server specific fatal cleanup */
416 + case SSH_CONNECTION_ABANDON: /* bailing with fatal error */
418 + * This seems to occur with OpenSSH client when
419 + * the user login shell exits.
422 + audit_logout(); /* ADT_logout; */
423 + logged_in = B_FALSE;
425 + } else if (!did_maxtries) {
426 + fail = PAM_AUTHINFO_UNAVAIL;
428 + /* reset saw max tries */
429 + did_maxtries = FALSE;
436 + error("adt audit_event: unknown event %d", event);
437 + __auditd_debug("%d/%d:%d-unknown event %d",
438 + getpid(), getuid(), geteuid(), event);
446 + * Called when a user session is started. Argument is the tty allocated to
447 + * the session, or NULL if no tty was allocated.
449 + * Note that this may be called multiple times if multiple sessions are used
450 + * within a single connection.
454 +audit_session_open(struct logininfo *li)
456 + const char *t = li->line ? li->line : "(no tty)";
458 + debug("adt audit_session_open: user=%s:tty=%s", audit_username(),
460 + __auditd_debug("%d/%d:%d-adt audit_session_open:ctxt=%p "
461 + "user=%s:tty=%s\n", getpid(), getuid(), geteuid(),
462 + (void *)the_authctxt, audit_username(), t);
467 + * Called when a user session is closed. Argument is the tty allocated to
468 + * the session, or NULL if no tty was allocated.
470 + * Note that this may be called multiple times if multiple sessions are used
471 + * within a single connection.
475 +audit_session_close(struct logininfo *li)
477 + const char *t = li->line ? li->line : "(no tty)";
479 + debug("adt audit_session_close: user=%s:tty=%s", audit_username(),
481 + __auditd_debug("%d/%d:%d-adt audit_session_close:ctxt=%p "
482 + "user=%s:tty=%s\n", getpid(), getuid(), geteuid(),
483 + (void *)the_authctxt, audit_username(), t);
488 + * This will be called when a user runs a non-interactive command. Note that
489 + * it may be called multiple times for a single connection since SSH2 allows
490 + * multiple sessions within a single connection.
494 +audit_run_command(const char *command)
496 + debug("adt audit_run_command: \"%s\"", command);
497 + __auditd_debug("%d/%d:%d-adt audit_run_command:ctxt=%p \"%s\"\n",
498 + getpid(), getuid(), geteuid(), (void *)the_authctxt, command);
503 + * audit_login - audit successful login
505 + * Entry the_authctxt should be valid ;-)
506 + * and pam_setcred called.
507 + * adt_info & ADT_INFO_PW_SUCCESS if successful
510 + * Exit ah = audit session established for audit_logout();
515 + adt_event_data_t *event;
516 + uid_t uid = ADT_NO_ATTRIB;
517 + gid_t gid = (gid_t)ADT_NO_ATTRIB;
520 + if ((the_authctxt != NULL) && (the_authctxt->valid != 0)) {
521 + uid = the_authctxt->pw->pw_uid;
522 + gid = the_authctxt->pw->pw_gid;
525 + if (adt_start_session(&ah, NULL, ADT_USE_PROC_DATA) != 0) {
526 + error("adt_start_session: %s", strerror(errno));
530 + adt_get_auid(ah, &auid);
532 + if (adt_set_user(ah, uid, gid, uid, gid, NULL,
533 + auid == AU_NOAUDITID ? ADT_NEW : ADT_USER)) {
534 + error("adt_set_user auid=%d, uid=%d", auid, uid);
535 + (void) adt_end_session(ah);
541 + if ((event = adt_alloc_event(ah, ADT_ssh)) == NULL) {
542 + error("adt_alloc_event(ADT_ssh): %s", strerror(errno));
545 + if (adt_put_event(event, ADT_SUCCESS, ADT_SUCCESS) != 0) {
546 + error("adt_put_event(ADT_ssh, ADT_SUCCESS): %s",
549 + /* should audit successful password change here */
550 + adt_free_event(event);
554 + * audit_logout - audit the logout
556 + * Entry ah = audit session.
561 + adt_event_data_t *event;
563 + if ((event = adt_alloc_event(ah, ADT_logout)) == NULL) {
564 + error("adt_alloc_event(ADT_logout): %s", strerror(errno));
567 + if (adt_put_event(event, ADT_SUCCESS, ADT_SUCCESS) != 0) {
568 + error("adt_put_event(ADT_logout, ADT_SUCCESS): %s",
571 + adt_free_event(event);
572 + (void) adt_end_session(ah);
577 + * audit_fail - audit login failure.
579 + * Entry the_authctxt assumed to have some info.
580 + * user = user who asked to be authenticated.
581 + * tid = connection audit TID set by audit_connect_from();
583 + * N.B. pam_strerror() prototype takes a pam handle and error number.
584 + * At least on Solaris, pam_strerror never uses the pam handle.
585 + * Since there doesn't seem to be a pam handle available, this
586 + * code just uses NULL.
589 +audit_fail(int pamerr)
591 + adt_session_data_t *ah = NULL;
592 + adt_event_data_t *event;
593 + uid_t uid = ADT_NO_ATTRIB;
594 + gid_t gid = (gid_t)ADT_NO_ATTRIB;
596 + __auditd_debug("%d/%d:%d-audit_fail(%s) ctxt=%p\n",
597 + getpid(), getuid(), geteuid(), pam_strerror(NULL, pamerr),
598 + (void *)the_authctxt);
599 + if (the_authctxt != NULL) {
600 + uid_t pwuid = ADT_NO_ATTRIB;
602 + if (the_authctxt->pw != NULL) {
603 + pwuid = the_authctxt->pw->pw_uid;
605 + __auditd_debug("valid=%d, user=%s, uid=%d\n",
606 + the_authctxt->valid, audit_username(), pwuid);
608 + __auditd_debug("\tNo autxctxt\n");
611 + if (pamerr == PAM_IGNORE) {
614 + if ((the_authctxt != NULL) && (the_authctxt->valid != 0)) {
615 + uid = the_authctxt->pw->pw_uid;
616 + gid = the_authctxt->pw->pw_gid;
617 + } else if ((the_authctxt != NULL) && (the_authctxt->user != NULL)) {
620 + if ((pw = getpwnam(the_authctxt->user)) != NULL) {
625 + if (adt_start_session(&ah, NULL, 0) != 0) {
626 + error("adt_start_session(ADT_ssh, 0, fail=%s):"
627 + " %s", pam_strerror(NULL, pamerr), strerror(errno));
628 + __auditd_debug("%d/%d:%d-adt_start_session(ADT_ssh, "
629 + "PROC_DATA, fail=%s): %s", getpid(), getuid(),
630 + geteuid(), pam_strerror(NULL, pamerr),
634 + __auditd_debug("%d/%d:%d-audit_fail+start_session() ah=%p\n",
635 + getpid(), getuid(), geteuid(), (void *)ah);
636 + if (adt_set_user(ah, uid, gid, uid, gid, tid, ADT_NEW) != 0) {
637 + error("adt_set_user(ADT_ssh, PROC_DATA, fail=%s): %s",
638 + pam_strerror(NULL, pamerr), strerror(errno));
639 + __auditd_debug("%d/%d:%d-adt_set_user(ADT_ssh, "
640 + "PROC_DATA, fail=%s): %s", getpid(), getuid(),
641 + geteuid(), pam_strerror(NULL, pamerr),
645 + __auditd_debug("%d/%d:%d-audit_fail+set_user() ah=%p\n", getpid(),
646 + getuid(), geteuid(), (void *)ah);
647 + if ((event = adt_alloc_event(ah, ADT_ssh)) == NULL) {
648 + error("adt_alloc_event(ADT_ssh, fail=%s): %s",
649 + pam_strerror(NULL, pamerr), strerror(errno));
650 + __auditd_debug("%d/%d:%d-adt_set_user(ADT_ssh, 0, "
651 + "fail=%s): %s", getpid(), getuid(), geteuid(),
652 + pam_strerror(NULL, pamerr), strerror(errno));
653 + } else if (adt_put_event(event, ADT_FAILURE,
654 + ADT_FAIL_PAM + pamerr) != 0) {
655 + error("adt_put_event(ADT_ssh, fail=%s): %s",
656 + pam_strerror(NULL, pamerr), strerror(errno));
657 + __auditd_debug("%d/%d:%d-adt_put_event(ADT_ssh, fail=%s): %s",
658 + getpid(), getuid(), geteuid(), pam_strerror(NULL, pamerr),
661 + __auditd_debug("%d/%d:%d-audit_fail+put_event() ah=%p\n", getpid(),
662 + getuid(), geteuid(), (void *)ah);
663 + /* should audit authentication with failed password change here. */
664 + adt_free_event(event);
666 + (void) adt_end_session(ah);
668 +#endif /* USE_SOLARIS_AUDIT */
669 --- hpn-ssh-hpn-18.4.2/audit.c.orig
670 +++ hpn-ssh-hpn-18.4.2/audit.c
672 * has been attempted.
675 -audit_connection_from(const char *host, int port)
676 +audit_connection_from(struct ssh *, const char *host, int port)
678 debug("audit connection from %s port %d euid %d", host, port,
680 --- hpn-ssh-hpn-18.4.2/audit.h.orig
681 +++ hpn-ssh-hpn-18.4.2/audit.h
684 typedef enum ssh_audit_event_type ssh_audit_event_t;
686 -void audit_connection_from(const char *, int);
687 +void audit_connection_from(struct ssh *, const char *, int);
688 void audit_event(struct ssh *, ssh_audit_event_t);
689 void audit_session_open(struct logininfo *);
690 void audit_session_close(struct logininfo *);
691 --- hpn-ssh-hpn-18.4.2/configure.ac.orig
692 +++ hpn-ssh-hpn-18.4.2/configure.ac
693 @@ -1769,7 +1769,7 @@
697 - [ --with-audit=module Enable audit support (modules=debug,bsm,linux)],
698 + [ --with-audit=module Enable audit support (modules=debug,bsm,linux,solaris)],
700 AC_MSG_CHECKING([for supported audit module])
702 @@ -1806,6 +1806,13 @@
703 SSHDLIBS="$SSHDLIBS -laudit"
704 AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module])
707 + AC_MSG_RESULT([solaris])
708 + AUDIT_MODULE=solaris
709 + AC_CHECK_HEADERS([bsm/adt.h])
710 + SSHDLIBS="$SSHDLIBS -lbsm"
711 + AC_DEFINE([USE_SOLARIS_AUDIT], [1], [Use Solaris audit module])
715 AC_MSG_RESULT([debug])
716 --- hpn-ssh-hpn-18.4.2/defines.h.orig
717 +++ hpn-ssh-hpn-18.4.2/defines.h
719 # define CUSTOM_SSH_AUDIT_EVENTS
722 +#ifdef USE_SOLARIS_AUDIT
723 +# define SSH_AUDIT_EVENTS
724 +# define CUSTOM_SSH_AUDIT_EVENTS
727 #if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
728 # define __func__ __FUNCTION__
729 #elif !defined(HAVE___func__)
730 --- hpn-ssh-hpn-18.4.2/sshd.c.orig
731 +++ hpn-ssh-hpn-18.4.2/sshd.c
732 @@ -2216,7 +2216,7 @@
733 remote_ip = ssh_remote_ipaddr(ssh);
735 #ifdef SSH_AUDIT_EVENTS
736 - audit_connection_from(remote_ip, remote_port);
737 + audit_connection_from(ssh, remote_ip, remote_port);
740 rdomain = ssh_packet_rdomain_in(ssh);
741 @@ -2308,8 +2308,10 @@
744 #ifdef SSH_AUDIT_EVENTS
745 +#ifndef USE_SOLARIS_AUDIT
746 audit_event(ssh, SSH_AUTH_SUCCESS);
751 if (options.gss_authentication) {
752 @@ -2338,6 +2340,10 @@
756 +#ifdef USE_SOLARIS_AUDIT
757 + /* Audit should take place after all successful pam */
758 + audit_event(ssh, SSH_AUTH_SUCCESS);
759 +#endif /* USE_SOLARIS_AUDIT */
762 * In privilege separation, we fork another child and prepare