summaryrefslogtreecommitdiff
path: root/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch')
-rw-r--r--testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch b/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch
new file mode 100644
index 000000000..7f6c7a751
--- /dev/null
+++ b/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch
@@ -0,0 +1,69 @@
+diff -Naur nfs-utils-1.1.6.orig/utils/gssd/krb5_util.c nfs-utils-1.1.6/utils/gssd/krb5_util.c
+--- utils/gssd/krb5_util.c 2009-04-20 19:32:50.000000000 +0200
++++ utils/gssd/krb5_util.c 2009-04-20 20:57:31.000000000 +0200
+@@ -940,9 +940,37 @@
+ {
+ krb5_error_code ret;
+ krb5_creds creds;
+- krb5_cc_cursor cur;
+ int found = 0;
+
++#ifdef HAVE_HEIMDAL
++ krb5_creds pattern;
++ krb5_realm *client_realm;
++
++ krb5_cc_clear_mcred(&pattern);
++
++ client_realm = krb5_princ_realm (context, principal);
++
++ ret = krb5_make_principal (context, &pattern.server,
++ *client_realm, KRB5_TGS_NAME, *client_realm,
++ NULL);
++ if (ret)
++ krb5_err (context, 1, ret, "krb5_make_principal");
++ pattern.client = principal;
++
++ ret = krb5_cc_retrieve_cred (context, ccache, 0, &pattern, &creds);
++ krb5_free_principal (context, pattern.server);
++ if (ret) {
++ if (ret == KRB5_CC_END)
++ return 1;
++ krb5_err (context, 1, ret, "krb5_cc_retrieve_cred");
++ }
++
++ found = creds.times.endtime > time(NULL);
++
++ krb5_free_cred_contents (context, &creds);
++#else
++ krb5_cc_cursor cur;
++
+ ret = krb5_cc_start_seq_get(context, ccache, &cur);
+ if (ret)
+ return 0;
+@@ -962,6 +990,7 @@
+ krb5_free_cred_contents(context, &creds);
+ }
+ krb5_cc_end_seq_get(context, ccache, &cur);
++#endif
+
+ return found;
+ }
+@@ -1008,6 +1037,9 @@
+ }
+ krb5_free_principal(context, principal);
+ err_princ:
++#ifdef HAVE_HEIMDAL
++#define KRB5_TC_OPENCLOSE 0x00000001
++#endif
+ krb5_cc_set_flags(context, ccache, KRB5_TC_OPENCLOSE);
+ krb5_cc_close(context, ccache);
+ err_cache:
+@@ -1262,7 +1294,7 @@
+ if (context != NULL) {
+ origmsg = krb5_get_error_message(context, code);
+ msg = strdup(origmsg);
+- krb5_free_error_message(context, origmsg);
++ krb5_free_error_string(context, origmsg);
+ }
+ #endif
+ if (msg != NULL)