author | Tomas Kuthan <tomas.kuthan@oracle.com> |
Tue, 23 Sep 2014 01:22:59 -0700 | |
changeset 2105 | b5dd48f1394b |
permissions | -rw-r--r-- |
2105
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
1 |
# |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
2 |
# Private symbol cannot_audit() was demoted to local in libbsm.so and is no |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
3 |
# longer available to its consumers. For OpenSSH sshd this was causing runtime |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
4 |
# linker errors at accepting connections from clients. |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
5 |
# |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
6 |
# On S12 audit is always enabled. As an interim solution to unbreak OpenSSH |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
7 |
# with S12_57+ libbsm.so, we remove the calls to cannot_audit(). |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
8 |
# |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
9 |
# Symbol aug_get_machine was demoted to local too. OpenSSH configure checks |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
10 |
# for aug_get_machine in libbsm.so and provides its own implementation if not |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
11 |
# present. To avoid OpenSSH built on an S12_56- build machine failing with |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
12 |
# run-time liker error on S12_57+ system, we overrule configure's |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
13 |
# HAVE_AUG_GET_MACHINE directly in the code. |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
14 |
# |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
15 |
# This patch will be removed once 19629847 is integrated. |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
16 |
# |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
17 |
diff -ur old/audit-bsm.c new/audit-bsm.c |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
18 |
--- old/audit-bsm.c 2012-02-23 15:40:43.000000000 -0800 |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
19 |
+++ new/audit-bsm.c 2014-09-18 05:16:43.210289238 -0700 |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
20 |
@@ -81,9 +81,6 @@ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
21 |
#define AUToReturnFunc(a,b) au_to_return((a), (u_int)(b)) |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
22 |
#endif |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
23 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
24 |
-#ifndef cannot_audit |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
25 |
-extern int cannot_audit(int); |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
26 |
-#endif |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
27 |
extern void aug_init(void); |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
28 |
extern void aug_save_auid(au_id_t); |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
29 |
extern void aug_save_uid(uid_t); |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
30 |
@@ -126,6 +123,8 @@ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
31 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
32 |
/* Below is the low-level BSM interface code */ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
33 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
34 |
+/* Force local definition of aug_get_machine */ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
35 |
+#undef HAVE_AUG_GET_MACHINE |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
36 |
/* |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
37 |
* aug_get_machine is only required on IPv6 capable machines, we use a |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
38 |
* different mechanism in audit_connection_from() for IPv4-only machines. |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
39 |
@@ -355,8 +354,6 @@ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
40 |
AuditInfoTermID *tid = &ssh_bsm_tid; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
41 |
char buf[1024]; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
42 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
43 |
- if (cannot_audit(0)) |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
44 |
- return; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
45 |
debug3("BSM audit: connection from %.100s port %d", host, port); |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
46 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
47 |
/* populate our terminal id structure */ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
48 |
@@ -400,8 +397,6 @@ |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
49 |
static int logged_in = 0; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
50 |
const char *user = the_authctxt ? the_authctxt->user : "(unknown user)"; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
51 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
52 |
- if (cannot_audit(0)) |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
53 |
- return; |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
54 |
|
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
55 |
switch(event) { |
b5dd48f1394b
19628445 OpenSSH broken on S12_57 due to missing libbsm:cannot_audit()
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff
changeset
|
56 |
case SSH_AUTH_SUCCESS: |