]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_kerberos_ldap_group_acl: Add missing workarounds for Heimdal Kerberos
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 10 Nov 2015 02:13:13 +0000 (18:13 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 10 Nov 2015 02:13:13 +0000 (18:13 -0800)
error_message() function is not always provided.

helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc

index 21ccb47a41751d9a44df44d8b37ba8460bdda53f..cb0a4fbfb85e56e835cf7e7399a7d16b122e809d 100644 (file)
 
 #if HAVE_KRB5
 struct kstruct kparam;
+
+#if !HAVE_ERROR_MESSAGE && HAVE_KRB5_GET_ERROR_MESSAGE
+#define error_message(code) krb5_get_error_message(kparam.context,code)
+#elif !HAVE_ERROR_MESSAGE && HAVE_KRB5_GET_ERR_TEXT
+#define error_message(code) krb5_get_err_text(kparam.context,code)
+#elif !HAVE_ERROR_MESSAGE
+static char err_code[17];
+const char *KRB5_CALLCONV
+error_message(long code) {
+    snprintf(err_code,16,"%ld",code);
+    return err_code;
+}
 #endif
+#endif /* HAVE_KRB5 */
 
 void
 init_args(struct main_args *margs)