components/openssh/patches/005-openssh_krb5_build_fix.patch
author Huie-Ying Lee <huieying.lee@oracle.com>
Fri, 13 Mar 2015 17:05:08 -0700
branchs11-update
changeset 3946 b1e0e68de63b
permissions -rw-r--r--
PSARC 2012/335 OpenSSH migration PSARC 2013/115 Shared configuration for SunSSH & OpenSSH PSARC 2014/078 OpenSSH 6.5 PSARC 2014/342 pam_unix_session lastlog support 15769261 SUNBT7135649 Deliver OpenSSH 6.0P1 in the userland gate 18205826 upgrade OpenSSH to 6.5p1 19579776 OpenSSH doesn't need to reference lastlog anymore now that PAM session mgmt does 18267729 Delegating credentials in OpenSSH 18828925 migrate the disablebanner feature from SunSSH to OpenSSH 18890096 migrate PAM enhancements from SunSSH to OpenSSH 19629847 OpenSSH does not support Solaris Audit for login/logout. 17997193 misc. problems in Makefile and openssh.p5m 18268681 openssh has non-existent /usr/local/lib in its runpath 18528305 /var/empty should be delivered readonly 19034156 PAM coversation function for passwd auth method has an incorrect assumption 19906401 should set AUTHTOK to NULL after pam_authenticate in sshpam_auth_passwd() 19517432 OpenSSH does not update utmpx on login 19570656 GSSAPIAuthentication option should default to yes 19591379 X11Forwarding and ForwardX11Trusted should default to yes 19465507 Deprecate SunSSH-only server options (e.g. iMaxAuthTriesLog) in OpenSSH 18898794 ssh connections fail with openssh, same config works with sunssh 20549448 OpenSSH X86 server core dump at audit_event 20656125 OpenSSH ed25519 algorithm signature verification failure 18435439 problem in UTILITY/OPENSSH 18491957 problem in UTILITY/OPENSSH
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3946
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     1
#
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     2
# This is to work around an unresloved symbol problem with the Kerberos
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     3
# build option. Unlike MIT Kerberos, the gss_krb5_copy_ccache() function
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     4
# is not supported on Solaris, because it violates API abstraction. This
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     5
# workaround disables delegated credentials storing on server side.
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     6
#
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     7
# The long term goal is to replace Solaris Kerberos libraries with MIT Kerberos
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     8
# delivered from Userland gate (The Solaris MIT Kerberos Drop in Project).
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     9
# After that, function gss_krb5_copy_ccache() will be available in Solaris and
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    10
# the delegating credentials functionality will be made available using the
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    11
# upstream code.
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    12
#
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    13
--- orig/auth2-gss.c	Fri Mar 21 10:41:03 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    14
+++ new/auth2-gss.c	Fri Mar 21 11:13:57 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    15
@@ -47,6 +47,10 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    16
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    17
 extern ServerOptions options;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    18
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    19
+#ifdef KRB5_BUILD_FIX
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    20
+        extern gss_OID_set g_supported;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    21
+#endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    22
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    23
 static void input_gssapi_token(int type, u_int32_t plen, void *ctxt);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    24
 static void input_gssapi_mic(int type, u_int32_t plen, void *ctxt);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    25
 static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    26
@@ -77,7 +81,13 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    27
 		return (0);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    28
 	}
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    29
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    30
+#ifdef KRB5_BUILD_FIX
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    31
+	/* use value obtained in privileged parent */
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    32
+	supported = g_supported;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    33
+#else
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    34
 	ssh_gssapi_supported_oids(&supported);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    35
+#endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    36
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    37
 	do {
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    38
 		mechs--;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    39
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    40
--- orig/configure	Fri Mar 21 10:41:03 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    41
+++ new/configure	Fri Mar 21 11:02:11 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    42
@@ -16634,6 +16634,12 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    43
 				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    44
 $as_echo "no" >&6; }
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    45
 			fi
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    46
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    47
+			# Oracle Solaris
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    48
+			# OpenSSH is mixed-up gssapi AND krb5 aplication
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    49
+			K5CFLAGS="$K5CFLAGS `$KRB5CONF --cflags krb5`"
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    50
+			K5LIBS="$K5LIBS `$KRB5CONF --libs krb5`"
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    51
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    52
 			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Heimdal" >&5
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    53
 $as_echo_n "checking whether we are using Heimdal... " >&6; }
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    54
 			cat confdefs.h - <<_ACEOF >conftest.$ac_ext
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    55
--- orig/sshd.c	Fri Mar 21 10:41:03 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    56
+++ new/sshd.c	Fri Mar 21 11:09:30 2014
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    57
@@ -259,6 +259,11 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    58
 /* Unprivileged user */
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    59
 struct passwd *privsep_pw = NULL;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    60
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    61
+#if defined(KRB5_BUILD_FIX) && defined(GSSAPI)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    62
+/* Temporary storing supported GSS mechs */
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    63
+gss_OID_set g_supported;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    64
+#endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    65
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    66
 /* Prototypes for various functions defined later in this file. */
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    67
 void destroy_sensitive_data(void);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    68
 void demote_sensitive_data(void);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    69
@@ -1407,6 +1412,10 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    70
 	av = saved_argv;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    71
 #endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    72
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    73
+#if defined(KRB5_BUILD_FIX) && defined(GSSAPI)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    74
+	OM_uint32 ms;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    75
+#endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    76
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    77
 	if (geteuid() == 0 && setgroups(0, NULL) == -1)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    78
 		debug("setgroups(): %.200s", strerror(errno));
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    79
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    80
@@ -2083,6 +2092,11 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    81
 	buffer_init(&loginmsg);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    82
 	auth_debug_reset();
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    83
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    84
+#if defined(KRB5_BUILD_FIX) && defined(GSSAPI)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    85
+	/* collect gss mechs for later use in privsep child */
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    86
+	ssh_gssapi_supported_oids(&g_supported);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    87
+#endif
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    88
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    89
 	if (use_privsep) {
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    90
 		if (privsep_preauth(authctxt) == 1)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    91
 			goto authenticated;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    92
@@ -2120,6 +2134,10 @@
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    93
 		startup_pipe = -1;
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    94
 	}
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    95
 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    96
+#if defined(KRB5_BUILD_FIX) && defined(GSSAPI)
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    97
+	gss_release_oid_set(&ms, &g_supported);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    98
+#endif 
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    99
+
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   100
 #ifdef SSH_AUDIT_EVENTS
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   101
 	audit_event(SSH_AUTH_SUCCESS);
b1e0e68de63b PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   102
 #endif