summaryrefslogtreecommitdiff
blob: 707364df2f97929a16a0429bd028b998679de726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- autofs-5.0.3.orig/modules/cyrus-sasl.c	2008-04-28 16:17:03.000000000 +0200
+++ autofs-5.0.3/modules/cyrus-sasl.c	2008-04-28 16:41:58.000000000 +0200
@@ -66,6 +66,15 @@
 #endif
 #endif
 
+/**
+ * The type of a principal is different for MIT Krb5 and Heimdal.
+ * These macros are provided by Heimdal, and introduced here for MIT.
+ */
+#ifndef krb5_realm_length
+#define krb5_realm_length(r) ((r).length)
+#define krb5_realm_data(r) ((r).data)
+#endif
+
 /*
  *  Once a krb5 credentials cache is setup, we need to set the KRB5CCNAME
  *  environment variable so that the library knows where to find it.
@@ -452,11 +461,11 @@
 
 	/* setup a principal for the ticket granting service */
 	ret = krb5_build_principal_ext(ctxt->krb5ctxt, &tgs_princ,
-		krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->length,
-		krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->data,
+		krb5_realm_length(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)),
+		krb5_realm_data(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)),
 		strlen(KRB5_TGS_NAME), KRB5_TGS_NAME,
-		krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->length,
-		krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->data,
+		krb5_realm_length(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)),
+		krb5_realm_data(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)),
 		0);
 	if (ret) {
 		error(logopt,