[24206] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r23807 - in trunk/athena/bin/discuss: debian libds server

daemon@ATHENA.MIT.EDU (Evan Broder)
Mon May 18 18:49:00 2009

Date: Mon, 18 May 2009 18:48:49 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200905182248.n4IMmnON018454@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: broder
Date: 2009-05-18 18:48:49 -0400 (Mon, 18 May 2009)
New Revision: 23807

Modified:
   trunk/athena/bin/discuss/debian/changelog
   trunk/athena/bin/discuss/libds/Makefile.in
   trunk/athena/bin/discuss/libds/auth_krb.c
   trunk/athena/bin/discuss/libds/res_module.c
   trunk/athena/bin/discuss/libds/rpcall.c
   trunk/athena/bin/discuss/server/Makefile.in
   trunk/athena/bin/discuss/server/rpproc.c
Log:
In discuss:
  * Use HAVE_KRB4 and HAVE_KRB5 instead of KERBEROS and KERBEROS5.


Modified: trunk/athena/bin/discuss/debian/changelog
===================================================================
--- trunk/athena/bin/discuss/debian/changelog	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/debian/changelog	2009-05-18 22:48:49 UTC (rev 23807)
@@ -3,8 +3,9 @@
   * Add one-character aliases to discuss. Patch by Ben Kaduk. (Trac: #238)
   * Squash some lintian warnings by switching from ${Source-Version} to
     ${source:Version} and ${binary:Version}
+  * Use HAVE_KRB4 and HAVE_KRB5 instead of KERBEROS and KERBEROS5.
 
- -- Evan Broder <broder@mit.edu>  Mon, 18 May 2009 18:23:53 -0400
+ -- Evan Broder <broder@mit.edu>  Mon, 18 May 2009 18:48:39 -0400
 
 debathena-discuss (10.0.7-0debathena3) unstable; urgency=low
 

Modified: trunk/athena/bin/discuss/libds/Makefile.in
===================================================================
--- trunk/athena/bin/discuss/libds/Makefile.in	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/libds/Makefile.in	2009-05-18 22:48:49 UTC (rev 23807)
@@ -56,7 +56,7 @@
 	${RANLIB} libdsk.a
 
 res_module.k.o: res_module.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c res_module.c
+	${CC} ${ALL_CFLAGS} -c res_module.c
 	mv res_module.o res_module.k.o
 
 res_module.nk.o: res_module.c
@@ -64,10 +64,10 @@
 	mv res_module.o res_module.nk.o
 
 auth_krb.o:
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c auth_krb.c
+	${CC} ${ALL_CFLAGS} -c auth_krb.c
 
 rpcall.k.o:
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c rpcall.c
+	${CC} ${ALL_CFLAGS} -c rpcall.c
 	mv rpcall.o rpcall.k.o
 
 rpcall.nk.o:

Modified: trunk/athena/bin/discuss/libds/auth_krb.c
===================================================================
--- trunk/athena/bin/discuss/libds/auth_krb.c	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/libds/auth_krb.c	2009-05-18 22:48:49 UTC (rev 23807)
@@ -23,9 +23,9 @@
 #include <string.h>
 #include <ctype.h>
 #include "krb.h"
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include "krb5.h"
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
 char *local_host_name ();
 
@@ -45,14 +45,14 @@
 int *authl;
 int *result;
 {
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
      get_authenticator_krb5(service_id, checksum, authp, authl, result);
 #else
      get_authenticator_krb4(service_id, checksum, authp, authl, result);
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 }
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 get_authenticator_krb5 (service_id, checksum, authp, authl, result)
 char *service_id;
 int checksum;
@@ -116,7 +116,7 @@
          *result = 0;
      }
 }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
 get_authenticator_krb4 (service_id, checksum, authp, authl, result)
 char *service_id;

Modified: trunk/athena/bin/discuss/libds/res_module.c
===================================================================
--- trunk/athena/bin/discuss/libds/res_module.c	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/libds/res_module.c	2009-05-18 22:48:49 UTC (rev 23807)
@@ -33,18 +33,18 @@
 #include <string.h>
 #include <ctype.h>
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 #include "krb.h"
 #ifndef MAX_K_NAME_SZ
 /* @#$%^$ last minute changes by jtkohl */
 #define krb_get_lrealm get_krbrlm
 #endif
 static void ExpandHost ();
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include "krb5.h"
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
 #ifndef SNAME_SZ
 #define SNAME_SZ 30
@@ -228,11 +228,11 @@
 
     /* generate the service name, but concatenating "discuss.instance@realm"
      * desired realm. */
-#ifndef KERBEROS
+#ifndef HAVE_KRB4
     strcpy (service_id, "discuss@");
     strcpy (&service_id[8], REALM);
 #else
-#ifndef KERBEROS5
+#ifndef HAVE_KRB5
     strcpy (service_id, "discuss.");
     ExpandHost (myhnamep, &service_id[8], realm);
     strcat(service_id, "@");
@@ -248,14 +248,14 @@
         strcat (service_id, realmp);
     else
         strcat (service_id, realm);
-#endif /* KERBEROS5 */
-#endif /* KERBEROS */
+#endif /* HAVE_KRB5 */
+#endif /* HAVE_KRB4 */
     *hostp = myhnamep;
     *servp = service_id;
     *result = 0;
 }
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 /*
  *
  * ExpandHost -- takes a user string alias for a host, and converts it
@@ -289,11 +289,11 @@
     do {
 	if (isupper(*sp)) *dp=tolower(*sp);
 	else *dp = *sp;
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     } while (dp++,*sp++);
 #else
     } while (dp++,*sp && (*sp++ != '.'));
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     *(--dp) = 0;
 
     /* heuristics */
@@ -310,14 +310,14 @@
 
 const char *local_realm ()
 {
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     static char realm [REALM_SZ] = "";
 
     if (realm [0] == '\0')
 	krb_get_lrealm (realm, 1);
 
     return (realm);
-#else /* KERBEROS */
+#else /* HAVE_KRB4 */
     return (REALM);
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 }

Modified: trunk/athena/bin/discuss/libds/rpcall.c
===================================================================
--- trunk/athena/bin/discuss/libds/rpcall.c	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/libds/rpcall.c	2009-05-18 22:48:49 UTC (rev 23807)
@@ -38,9 +38,9 @@
 #include <discuss/tfile.h>
 #include "rpc.h"
 #include "config.h"
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include "krb5.h"
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
 /* DEFINES */
 
@@ -385,7 +385,7 @@
 	    sendshort(*authp++);
 	}
 	USP_end_block(us);
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 	/* Prior to server version 3, Kerberos 5 wasn't an available
 	 * authentication method, so we need to send a Kerberos 4 ticket.
 	 * Unfortunately, there's no way to query the server version sooner. */
@@ -428,7 +428,7 @@
 		USP_end_block(us);
 	    }
 	}
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     } else {
 	USP_begin_block(us,KRB_TICKET);	/* send blank ticket */
 	sendshort(0);

Modified: trunk/athena/bin/discuss/server/Makefile.in
===================================================================
--- trunk/athena/bin/discuss/server/Makefile.in	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/server/Makefile.in	2009-05-18 22:48:49 UTC (rev 23807)
@@ -74,7 +74,7 @@
 		$(LIBS) $(LDLIBS)
 
 rpproc.k.o: rpproc.c
-	${CC} ${ALL_CFLAGS} -DINETD -DKERBEROS5 -DKERBEROS -c rpproc.c
+	${CC} ${ALL_CFLAGS} -DINETD -c rpproc.c
 	mv rpproc.o rpproc.k.o
 
 rpproc.nk.o: rpproc.c
@@ -82,11 +82,11 @@
 	mv rpproc.o rpproc.nk.o
 
 rpproc.debug.o: rpproc.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c rpproc.c
+	${CC} ${ALL_CFLAGS} -c rpproc.c
 	mv rpproc.o rpproc.debug.o
 
 core.o: core.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c core.c
+	${CC} ${ALL_CFLAGS} -c core.c
 
 coreutil.o: coreutil.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c coreutil.c
+	${CC} ${ALL_CFLAGS} -c coreutil.c

Modified: trunk/athena/bin/discuss/server/rpproc.c
===================================================================
--- trunk/athena/bin/discuss/server/rpproc.c	2009-05-18 22:47:44 UTC (rev 23806)
+++ trunk/athena/bin/discuss/server/rpproc.c	2009-05-18 22:48:49 UTC (rev 23807)
@@ -44,10 +44,10 @@
 #include <errno.h>
 #include <pwd.h>
 #include <string.h>
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 #include <krb.h>
 #endif
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include <krb5.h>
 #endif
 #include <discuss/tfile.h>
@@ -60,7 +60,7 @@
 #define min(a, b) (a < b ? a : b)
 
 /* global */
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 char rpc_caller[MAX_K_NAME_SZ + 1];
 #else
 char rpc_caller[50];
@@ -69,9 +69,9 @@
 
 extern int numprocs;
 extern struct proc_table procs [];
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 static char serv_name[20];
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 short recvshort();
 int rpc_err;
 extern tfile net_tfile ();
@@ -108,7 +108,7 @@
     int s;
 #endif
     
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     int fromlen,i;
     struct sockaddr_in from;
     char hostname[50];
@@ -206,7 +206,7 @@
     strcat (rpc_caller, "@");
     strcat (rpc_caller, REALM);
     
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 
     strcpy(serv_name, service);
     fromlen = sizeof (from);
@@ -235,7 +235,7 @@
     return;
 }
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 handle_kerberos(bt,service,haddr)
 USPCardinal bt;
 char *service;
@@ -248,7 +248,7 @@
     AUTH_DAT kdata;
     KTEXT_ST ticket;
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     char *envvar;
     krb5_context context;
     krb5_auth_context auth_context = NULL;
@@ -256,7 +256,7 @@
     krb5_principal sprinc;
     krb5_keytab keytab = NULL;
     krb5_ticket *processed_ticket = NULL;
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
     strcpy (rpc_caller, "???@");		/* safety drop */
     strcat (rpc_caller, REALM);
@@ -270,7 +270,7 @@
     for (i=0; i<ticket.length; i++) {
 	ticket.dat[i] = recvshort();
     }
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     packet.length = ticket.length;
     packet.data = (krb5_pointer) ticket.dat;
     
@@ -279,7 +279,7 @@
 	sprintf(envvar, "KRB5_KTNAME=/var/spool/%s/krb5.keytab", service);
 	putenv(envvar);
     }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     /* make filename from service */
     strcpy (filename, "/var/spool/");
     strcat (filename, service);
@@ -287,7 +287,7 @@
 
     strcpy(instance, "*");
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     result = krb5_init_context(&context);
     if (result) {
         com_err(service, result, "while initializing krb5");
@@ -314,16 +314,16 @@
     else {  /* Let's try krb4 */
 	/* First, log the krb5 error. */
 	com_err(service, result, "while reading request");
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
         result = krb_rd_req (&ticket, service, instance, haddr, &kdata,
 	                     filename);
 	if (result) {
 	    result += ERROR_TABLE_BASE_krb;
 	    goto punt_kerberos;
 	}
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
     strcpy(rpc_caller, kdata.pname);
     if (kdata.pinst[0] != '\0') {
@@ -341,7 +341,7 @@
 	 USP_end_block(us);
     }
 }
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 
 /*
  *
@@ -362,13 +362,13 @@
 	return;
     }
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     if (bt == KRB_TICKET || bt == KRB_TICKET2) {
 	 handle_kerberos(bt, serv_name, hostaddr);
 	 *code = 0;
 	 return;
     }
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 
     procno = bt - PROC_BASE;
 


home help back first fref pref prev next nref lref last post