File krb5_auth_con_set_req_cksumtype-implicit-declaration.diff of Package cifs-utils

Author: Lars Mueller <lmuelle@suse.com>
Subject: cifs-utils build breaks with krb5 < 1.7
Bugzilla: na
Inspiration: https://bugzilla.samba.org/show_bug.cgi?id=6918
Upstream-Reported: http://permalink.gmane.org/gmane.linux.kernel.cifs/5932
Upstream-Acknowledged: Yes

Index: cifs-utils-5.4/configure.ac
===================================================================
--- cifs-utils-5.4.orig/configure.ac
+++ cifs-utils-5.4/configure.ac
@@ -178,6 +178,9 @@ if test $enable_cifsupcall != "no"; then
 	AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype])
 fi
 
+# MIT krb5 < 1.7 does not have this declaration but does have the symbol
+AC_CHECK_DECLS(krb5_auth_con_set_req_cksumtype, [], [], [#include <krb5.h>])
+
 LIBS=$cu_saved_libs
 
 AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"])
Index: cifs-utils-5.4/cifs.upcall.c
===================================================================
--- cifs-utils-5.4.orig/cifs.upcall.c
+++ cifs-utils-5.4/cifs.upcall.c
@@ -415,6 +415,14 @@ cifs_krb5_get_req(const char *host, cons
 	 */
 	in_data.data = discard_const_p(char, gss_cksum);
 	in_data.length = 24;
+
+	/* MIT krb5 < 1.7 is missing the prototype, but still has the symbol */
+#if !HAVE_DECL_KRB5_AUTH_CON_SET_REQ_CKSUMTYPE
+	krb5_error_code krb5_auth_con_set_req_cksumtype(
+		krb5_context      context,
+		krb5_auth_context auth_context,
+		krb5_cksumtype    cksumtype);
+#endif
 	ret = krb5_auth_con_set_req_cksumtype(context, auth_context, 0x8003);
 	if (ret) {
 		syslog(LOG_DEBUG, "%s: unable to set 0x8003 checksum",
openSUSE Build Service is sponsored by