[24451] in Source-Commits
/svn/athena r24042 - in trunk/athena/bin/grenew: . debian
daemon@ATHENA.MIT.EDU (Evan Broder)
Sat Oct 3 23:25:25 2009
Date: Sat, 3 Oct 2009 23:25:13 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200910040325.n943PDRJ013000@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: broder
Date: 2009-10-03 23:25:13 -0400 (Sat, 03 Oct 2009)
New Revision: 24042
Modified:
trunk/athena/bin/grenew/configure.in
trunk/athena/bin/grenew/debian/changelog
trunk/athena/bin/grenew/debian/rules
trunk/athena/bin/grenew/grenew.c
Log:
In grenew:
* Support building on systems where krb5 no longer comes with
krb4. (Trac: #380)
Modified: trunk/athena/bin/grenew/configure.in
===================================================================
--- trunk/athena/bin/grenew/configure.in 2009-10-02 19:17:31 UTC (rev 24041)
+++ trunk/athena/bin/grenew/configure.in 2009-10-04 03:25:13 UTC (rev 24042)
@@ -5,7 +5,6 @@
AC_PROG_CC
AC_PROG_INSTALL
-ATHENA_KRB4_REQUIRED
ATHENA_KRB5_REQUIRED
ATHENA_KRB4
ATHENA_KRB5
Modified: trunk/athena/bin/grenew/debian/changelog
===================================================================
--- trunk/athena/bin/grenew/debian/changelog 2009-10-02 19:17:31 UTC (rev 24041)
+++ trunk/athena/bin/grenew/debian/changelog 2009-10-04 03:25:13 UTC (rev 24042)
@@ -1,3 +1,10 @@
+debathena-grenew (10.0.1-0debathena1) unstable; urgency=low
+
+ * Support building on systems where krb5 no longer comes with
+ krb4. (Trac: #380)
+
+ -- Evan Broder <broder@mit.edu> Sat, 03 Oct 2009 23:20:43 -0400
+
debathena-grenew (10.0.0-0debathena2) unstable; urgency=low
* Change DEB_AUTO_UPDATE_AUTOCONF to 2.50, not 1.
Modified: trunk/athena/bin/grenew/debian/rules
===================================================================
--- trunk/athena/bin/grenew/debian/rules 2009-10-02 19:17:31 UTC (rev 24041)
+++ trunk/athena/bin/grenew/debian/rules 2009-10-04 03:25:13 UTC (rev 24042)
@@ -4,7 +4,15 @@
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
-DEB_CONFIGURE_EXTRA_FLAGS += --with-krb4=$(shell krb5-config --prefix krb4) --with-krb5
+KRB5_VERSION = $(shell dpkg-query --showformat='$${Version}' --show libkrb5-dev)
+ifeq ($(shell dpkg --compare-versions $(KRB5_VERSION) '<<' '1.7~' && echo y),y)
+ DEB_CONFIGURE_EXTRA_FLAGS += --with-krb4=$(shell krb4-config --prefix krb4)
+else
+ DEB_CONFIGURE_EXTRA_FLAGS += --without-krb4
+endif
+
+DEB_CONFIGURE_EXTRA_FLAGS += --with-krb5
+
clean::
rm -f configure
Modified: trunk/athena/bin/grenew/grenew.c
===================================================================
--- trunk/athena/bin/grenew/grenew.c 2009-10-02 19:17:31 UTC (rev 24041)
+++ trunk/athena/bin/grenew/grenew.c 2009-10-04 03:25:13 UTC (rev 24042)
@@ -6,7 +6,9 @@
#include <gtk/gtk.h>
#include <krb5.h>
+#ifdef HAVE_KRB4
#include <kerberosIV/krb.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <com_err.h>
@@ -25,10 +27,12 @@
int try_convert524(krb5_context kcontext, krb5_ccache ccache);
/* library functions not declared inside the included headers. */
+#ifdef HAVE_KRB4
void krb524_init_ets(krb5_context kcontext);
int krb524_convert_creds_kdc(krb5_context kcontext,
krb5_creds * k5creds,
CREDENTIALS * k4creds);
+#endif HAVE_KRB4
static void quit()
{
@@ -220,6 +224,7 @@
char *password;
krb5_deltat lifetime;
{
+#ifdef HAVE_KRB4
krb5_error_code code;
int krbval;
char v4name[ANAME_SZ], v4inst[INST_SZ], v4realm[REALM_SZ];
@@ -245,6 +250,9 @@
return 0;
}
return 1;
+#else
+ return 0;
+#endif
}
/* Convert krb5 tickets to krb4. This function was copied from kinit */
@@ -252,6 +260,7 @@
krb5_context kcontext;
krb5_ccache ccache;
{
+#ifdef HAVE_KRB4
krb5_principal me, kpcserver;
krb5_error_code kpccode;
int kpcval;
@@ -322,6 +331,9 @@
return 0;
}
return 1;
+#else
+ return 0;
+#endif
}
int main(int argc, char **argv)