Skip to contentSkip to conversation

sasl with heimdal kerberos

PATCH Martin von Gagern 2 participants 2 messages May 15, 2008 – May 16, 2008 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Hi!

I'm using Gentoo Linux with autofs-5.0.3, cyrus-sasl-2.1.22 and heimdal 0.7.2. I got compile time error messages when trying to compile autofs with sasl support. I reported them as https://bugs.gentoo.org/210762

Today I was made aware that the same issues were already mentioned on this mailing list here, in a thread titled "sasl compilation error"
http://www.mail-archive.com/[email protected]/msg06165.html

I just had a closer look at this, and found two useful macros defined in the heimdal headers, called krb5_realm_length and krb5_realm_data. MIT kerberos doesn't seem to define them, but a simple preprocessor siwtch is enough to introduce them in a MIT-compatible fashion.

With this I created a patch that causes autofs to compile on my system, and which I would expect to compile for all sane Heimdal and MIT setups, and to work correctly as well. Be warned, though, that I haven't got any real Kerberos set up here, so I didn't actually test that things work.

Greetings,
Martin von Gagern

P.S.: This is a repost of my original message from 2008-04-28.
Looks like that got lost as I wasn't subscribed at the time.

modules/cyrus-sasl.c +13 -4
@@ -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,

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

maintainer
#1 lore raw
Quoted 6 lines · Martin von Gagern

Hi!

I'm using Gentoo Linux with autofs-5.0.3, cyrus-sasl-2.1.22 and heimdal 0.7.2. I got compile time error messages when trying to compile autofs with sasl support. I reported them as https://bugs.gentoo.org/210762

Quoted 8 lines

Today I was made aware that the same issues were already mentioned on this mailing list here, in a thread titled "sasl compilation error"
http://www.mail-archive.com/[email protected]/msg06165.html

I just had a closer look at this, and found two useful macros defined in the heimdal headers, called krb5_realm_length and krb5_realm_data. MIT kerberos doesn't seem to define them, but a simple preprocessor siwtch is enough to introduce them in a MIT-compatible fashion.

Interesting.

Quoted 5 lines

With this I created a patch that causes autofs to compile on my system, and which I would expect to compile for all sane Heimdal and MIT setups, and to work correctly as well. Be warned, though, that I haven't got any real Kerberos set up here, so I didn't actually test that things work.

It would be good if someone could check this out.

Ian