*
* Created by: John T. Kohl
*
- * $Id: bdump.c,v 1.52 1999/01/22 23:19:39 ghudson Exp $
+ * $Source: /afs/dev.mit.edu/source/repository/athena/lib/zephyr/server/bdump.c,v $
+ * $Id: bdump.c,v 1.54 2001/02/27 04:43:01 zacheiss Exp $
+ * $Author: zacheiss $
*
* Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
#include <com_err.h>
#ifndef lint
-static const char rcsid_bdump_c[] = "$Id: bdump.c,v 1.52 1999/01/22 23:19:39 ghudson Exp $";
+static const char rcsid_bdump_c[] = "$Id: bdump.c,v 1.54 2001/02/27 04:43:01 zacheiss Exp $";
#endif /* lint */
/*
#ifdef HAVE_KRB4
static long ticket_time;
-static char my_realm[REALM_SZ];
#define TKTLIFETIME 120
#define tkt_lifetime(val) ((long) val * 5L * 60L)
cleanup(server);
return;
}
- /* my_realm is filled in inside get_tgt() */
+
if (strcmp(kdata.pname, SERVER_SERVICE) ||
strcmp(kdata.pinst, SERVER_INSTANCE) ||
- strcmp(kdata.prealm, my_realm)) {
+ strcmp(kdata.prealm, ZGetRealm())) {
syslog(LOG_ERR, "bdump_get: peer not zephyr in lrealm: %s.%s@%s",
kdata.pname, kdata.pinst,kdata.prealm);
cleanup(server);
Code_t retval;
u_short length;
+ memset (¬ice, 0, sizeof(notice));
+
retval = ZMakeAscii(addrbuf, sizeof(addrbuf),
(unsigned char *) &addr->sin_addr,
sizeof(struct in_addr));
Sched *s;
#endif
- if (!*my_realm) {
- retval = krb_get_lrealm(my_realm, 1);
- if (retval != KSUCCESS) {
- syslog(LOG_ERR,"krb_get_lrealm: %s", krb_get_err_text(retval));
- *my_realm = '\0';
- return(1);
- }
- }
/* have they expired ? */
- if (ticket_time < NOW - tkt_lifetime(TKTLIFETIME) + 15L) {
+ if (ticket_time < NOW - tkt_lifetime(TKTLIFETIME) + (15L * 60L)) {
/* +15 for leeway */
#if 0
zdbug((LOG_DEBUG,"get new tickets: %d %d %d", ticket_time, NOW,
}
#if defined (DEBUG)
if (zdebug) {
- char buf[4096];
-
- sprintf(buf, "bdump:%s '%s' '%s' '%s' '%s' '%s'",
+ syslog(LOG_DEBUG, "bdump:%s '%s' '%s' '%s' '%s' '%s'",
ZNoticeKinds[(int) notice.z_kind], notice.z_class,
notice.z_class_inst, notice.z_opcode, notice.z_sender,
notice.z_recipient);
- syslog(LOG_DEBUG, buf);
}
#endif /* DEBUG */
if (notice.z_num_other_fields >= 1) {
} else if (strcmp(notice.z_opcode, ADMIN_NEWREALM) == 0) {
/* get a realm from the message */
realm = realm_get_realm_by_name(notice.z_message);
- if (!realm)
- return(ZERR_NONE);
+ if (!realm) {
+ syslog(LOG_ERR, "brl newrlm failed: no realm %s",
+ notice.z_message);
+ }
} else if (strcmp(notice.z_class, LOGIN_CLASS) == 0) {
/* 1 = tell it we are authentic */
retval = ulogin_dispatch(¬ice, 1, &who, server);
syslog(LOG_ERR, "brl no client");
return ZSRV_NOCLT;
}
- retval = subscr_subscribe(client, ¬ice);
+ retval = subscr_subscribe(client, ¬ice, server);
if (retval != ZERR_NONE) {
syslog(LOG_WARNING, "brl subscr failed: %s",
error_message(retval));
}
} else if (strcmp(notice.z_opcode, REALM_SUBSCRIBE) == 0) {
/* add a subscription for a realm */
- if (!realm) {
- syslog(LOG_ERR, "brl no realm");
- return(ZSRV_NORLM);
- }
- retval = subscr_realm(realm, ¬ice);
- if (retval != ZERR_NONE) {
- syslog(LOG_WARNING, "brl subscr failed: %s",
- error_message(retval));
- return retval;
- }
+ if (realm) {
+ retval = subscr_realm(realm, ¬ice);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "brl subscr failed: %s",
+ error_message(retval));
+ return retval;
+ }
+ } /* else
+ /* Other side tried to send us subs for a realm we didn't
+ know about, and so we drop them silently */
+
} else {
syslog(LOG_ERR, "brl bad opcode %s",notice.z_opcode);
return ZSRV_UNKNOWNOPCODE;
int packlen;
Code_t retval;
+ memset (¬ice, 0, sizeof(notice));
+
notice.z_kind = kind;
notice.z_port = port;
notice.z_class = class_name;
Code_t retval;
u_short length;
+ memset (¬ice, 0, sizeof(notice));
+
notice.z_kind = kind;
notice.z_port = port;
notice.z_class = class_name;