[24210] in Source-Commits
/svn/athena r23811 - in trunk/athena/bin/discuss: dsgrep ets libds
daemon@ATHENA.MIT.EDU (Evan Broder)
Mon May 18 21:10:44 2009
Date: Mon, 18 May 2009 21:10:34 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200905190110.n4J1AYJm028504@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 21:10:34 -0400 (Mon, 18 May 2009)
New Revision: 23811
Modified:
trunk/athena/bin/discuss/dsgrep/regerror.c
trunk/athena/bin/discuss/ets/discuss_err.et
trunk/athena/bin/discuss/ets/rpc_et.et
trunk/athena/bin/discuss/libds/auth_krb.c
trunk/athena/bin/discuss/libds/rpcall.c
Log:
Add various changes so that discuss will build without krb4.
Modified: trunk/athena/bin/discuss/dsgrep/regerror.c
===================================================================
--- trunk/athena/bin/discuss/dsgrep/regerror.c 2009-05-18 23:50:03 UTC (rev 23810)
+++ trunk/athena/bin/discuss/dsgrep/regerror.c 2009-05-19 01:10:34 UTC (rev 23811)
@@ -13,6 +13,7 @@
#endif
#include <stdio.h>
+#include <stdlib.h>
void regerror(msg)
char *msg;
{
Modified: trunk/athena/bin/discuss/ets/discuss_err.et
===================================================================
--- trunk/athena/bin/discuss/ets/discuss_err.et 2009-05-18 23:50:03 UTC (rev 23810)
+++ trunk/athena/bin/discuss/ets/discuss_err.et 2009-05-19 01:10:34 UTC (rev 23811)
@@ -32,4 +32,7 @@
ec DISC_ACTION_NOT_PERFORMED,
"Action not performed"
+ ec DISC_NO_KRB
+ "No Kerberos support built in"
+
end
Modified: trunk/athena/bin/discuss/ets/rpc_et.et
===================================================================
--- trunk/athena/bin/discuss/ets/rpc_et.et 2009-05-18 23:50:03 UTC (rev 23810)
+++ trunk/athena/bin/discuss/ets/rpc_et.et 2009-05-19 01:10:34 UTC (rev 23811)
@@ -36,4 +36,7 @@
ec RPC_NO_ADDR,
"Host has no network address"
+ ec RPC_SERVER_TOO_OLD,
+ "RPC server too old"
+
end
Modified: trunk/athena/bin/discuss/libds/auth_krb.c
===================================================================
--- trunk/athena/bin/discuss/libds/auth_krb.c 2009-05-18 23:50:03 UTC (rev 23810)
+++ trunk/athena/bin/discuss/libds/auth_krb.c 2009-05-19 01:10:34 UTC (rev 23811)
@@ -22,7 +22,9 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_KRB4
#include "krb.h"
+#endif /* HAVE_KRB4 */
#ifdef HAVE_KRB5
#include "krb5.h"
#endif /* HAVE_KRB5 */
@@ -47,9 +49,12 @@
{
#ifdef HAVE_KRB5
get_authenticator_krb5(service_id, checksum, authp, authl, result);
-#else
+#elif HAVE_KRB4
get_authenticator_krb4(service_id, checksum, authp, authl, result);
-#endif /* HAVE_KRB5 */
+#else /* No Kerberos */
+ printf("get_authenticator", DISC_NO_KRB, "while initializing authentication");
+ exit(1);
+#endif
}
#ifdef HAVE_KRB5
@@ -74,7 +79,7 @@
exit(1);
}
- initialize_krb_error_table();
+ initialize_krb5_error_table();
realmp = strchr (service_id, '@');
if (realmp == NULL || realmp - service_id >= sizeof (serv)) {
@@ -118,6 +123,7 @@
}
#endif /* HAVE_KRB5 */
+#ifdef HAVE_KRB4
get_authenticator_krb4 (service_id, checksum, authp, authl, result)
char *service_id;
int checksum;
@@ -162,4 +168,4 @@
*result = rem + ERROR_TABLE_BASE_krb;
}
}
-
+#endif /* HAVE_KRB4 */
Modified: trunk/athena/bin/discuss/libds/rpcall.c
===================================================================
--- trunk/athena/bin/discuss/libds/rpcall.c 2009-05-18 23:50:03 UTC (rev 23810)
+++ trunk/athena/bin/discuss/libds/rpcall.c 2009-05-19 01:10:34 UTC (rev 23811)
@@ -41,6 +41,7 @@
#ifdef HAVE_KRB5
#include "krb5.h"
#endif /* HAVE_KRB5 */
+#include "rpc_et.h"
/* DEFINES */
@@ -385,7 +386,6 @@
sendshort(*authp++);
}
USP_end_block(us);
-#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. */
@@ -396,6 +396,7 @@
char realm[30];
krb5_context context;
if (get_server_version() < SERVER_3) {
+#if defined(HAVE_KRB5) && defined(HAVE_KRB4)
kcode = krb5_init_context(&context);
if (kcode) {
com_err("discuss", kcode, "while initializing krb5");
@@ -427,8 +428,10 @@
}
USP_end_block(us);
}
+#else /* HAVE_KRB5 && HAVE_KRB4 */
+ com_err("discuss", RPC_SERVER_TOO_OLD, "while authenticating to discuss server");
+#endif /* HAVE_KRB5 && HAVE_KRB4 */
}
-#endif /* HAVE_KRB5 */
} else {
USP_begin_block(us,KRB_TICKET); /* send blank ticket */
sendshort(0);