--- tzc-2.6.15.orig/Makefile
+++ tzc-2.6.15/Makefile
@@ -1,12 +1,9 @@
 # Configure as appropriate.
 
-KERB_INCLUDES = -I/usr/local/include
-KERB_LIBDIR = /usr/local/lib
-KERB_LIBS = -L$(KERB_LIBDIR) -lkrb -ldes -lcom_err
-
-ZEPHYR_INCLUDES = -I/usr/local/include
-ZEPHYR_LIBDIR = /usr/local/lib
-ZEPHYR_LIBS = -L$(ZEPHYR_LIBDIR) -lzephyr
+#KERB_LIBS = -lkrb4 -ldes425 -lcom_err
+ZEPHYR_LIBS = -lzephyr -lcom_err
+
+DESTDIR = 
 
 # You may need to use these to pick up some BSD'ish functions like flock().
 # Linux needs MISC_LIBS = -lbsd
@@ -20,6 +17,11 @@
 # uncomment this if getenv() isn't already available (e.g. SunOS 4.1.x)
 # EXTRA_OBJS = getenv.o
 
+# This is not included since in some cases it can do more harm than good.
+#EXTRA_OBJS = ZCkAuth.o 
+
+OBJS = tzc.o lread.o $(EXTRA_OBJS)
+
 CC = gcc
 LD = $(CC)
 
@@ -29,10 +31,14 @@
 
 LIBS = $(ZEPHYR_LIBS) $(KERB_LIBS) $(MISC_LIBS)
 
-tzc: tzc.o lread.o $(EXTRA_OBJS)
-	$(LD) $(LDFLAGS) -o tzc.new tzc.o lread.o $(EXTRA_OBJS) $(LIBS)
+tzc: $(OBJS) 
+	$(LD) $(LDFLAGS) -o tzc.new $(OBJS) $(LIBS)
 	/bin/mv tzc.new tzc
 
+install: tzc
+	install tzc $(DESTDIR)/usr/bin
+	install tzc.1 $(DESTDIR)/usr/share/man/man1
+
 lread.o: lread.h
 tzc.o: lread.h
 
--- tzc-2.6.15.orig/ZCkAuth.c
+++ tzc-2.6.15/ZCkAuth.c
@@ -0,0 +1,79 @@
+/* Modifications for tzc by Darrell Kindred <dkindred@cmu.edu>, April 1997:
+ *   - cache the kerberos credentials, so we can continue to check auth
+ *     even if the user re-kinits.
+ */
+
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It contains source for the ZCheckAuthentication function.
+ *
+ *	Created by:	Robert French
+ *
+ *	/mit/zephyr/src/CVS/zephyr/lib/zephyr/ZCkAuth.c,v
+ *	ghudson
+ *
+ *	Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
+ *	For copying and distribution information, see the file
+ *	"mit-copyright.h". 
+ */
+/* /mit/zephyr/src/CVS/zephyr/lib/zephyr/ZCkAuth.c,v 1.21 1995/06/30 22:03:53 ghudson Exp */
+
+#ifndef lint
+static char rcsid_ZCheckAuthentication_c[] =
+    "$Zephyr: /mit/zephyr/src/lib/RCS/ZCheckAuthentication.c,v 1.14 89/03/24 14:17:38 jtkohl Exp Locker: raeburn $";
+#endif
+
+#if 0
+#include <internal.h>
+#else
+#include <zephyr/zephyr.h>
+#define ZAUTH_UNSET (-3)      /* from internal.h */
+#include <stdio.h>	      /* for NULL */
+#endif
+
+/* Check authentication of the notice.
+   If it looks authentic but fails the Kerberos check, return -1.
+   If it looks authentic and passes the Kerberos check, return 1.
+   If it doesn't look authentic, return 0
+
+   When not using Kerberos, return true if the notice claims to be authentic.
+   Only used by clients; the server uses its own routine.
+ */
+Code_t ZCheckAuthentication(notice, from)
+    ZNotice_t *notice;
+    struct sockaddr_in *from;
+{	
+#ifdef ZEPHYR_USES_KERBEROS
+    int result;
+    ZChecksum_t our_checksum;
+    static CREDENTIALS cred;
+    static int got_cred = 0;
+
+    /* If the value is already known, return it. */
+    if (notice->z_checked_auth != ZAUTH_UNSET)
+	return (notice->z_checked_auth);
+
+    if (!notice->z_auth)
+	return (ZAUTH_NO);
+	
+    if (!got_cred &&
+	(result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, 
+			       __Zephyr_realm, &cred)) != 0)
+      return (ZAUTH_NO);
+
+    got_cred = 1;
+
+#ifdef NOENCRYPTION
+    our_checksum = 0;
+#else /* NOENCRYPTION */
+    our_checksum = des_quad_cksum(notice->z_packet, NULL, 
+                                notice->z_default_format+
+                                strlen(notice->z_default_format)+1-
+                                notice->z_packet, 0, cred.session);
+#endif /* NOENCRYPTION */
+    /* if mismatched checksum, then the packet was corrupted */
+    return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
+
+#else /* ZEPHYR_USES_KERBEROS */
+    return (notice->z_auth ? ZAUTH_YES : ZAUTH_NO);
+#endif
+} 
--- tzc-2.6.15.orig/tzc.c
+++ tzc-2.6.15/tzc.c
@@ -124,7 +124,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include "lread.h"
-#include <com_err.h>
+#include <et/com_err.h>
 #if USE_LIBCS
 #include <libcs.h>	      /* for snprintf */
 #endif
@@ -248,6 +248,7 @@
       Value *sym_register_query;
       Value *sym_query;
       Value *sym_id;
+      Value *sym_opcode;
    } constants;
 };
 
@@ -492,7 +493,7 @@
   if(!(pid = fork())) {
       char fn[1024];
       sprintf(fn,"%s/.zephyr.subs.tzc",getenv("HOME"));
-      execlp(ZCTL_BINARY,"zctl","load",fn,0);
+      execlp(ZCTL_BINARY,"zctl","load",fn,(char *)0);
       perror("zctl exec");
       fprintf(stderr,"Unable to load subscriptions.\n");
       bail(0);
@@ -640,7 +641,7 @@
    reentry = 0;
 }
 
-static void tzc_com_err_hook(const char *whoami, int errcode, 
+static void tzc_com_err_hook(const char *whoami, long errcode, 
 			     const char *fmt, va_list ap)
 {
     char buf1[4096], errmsg[4096];
@@ -733,7 +734,7 @@
     Value *recip_list;
     Value *message_list;
     int message_len;
-    char *message = 0, *class, *instance, *sender, *recipient;
+    char *message = 0, *class, *instance, *sender, *recipient, *opcode;
 
     /* emacs sends something of the form:
      * ((class . "MESSAGE") 
@@ -751,6 +752,12 @@
        goto fail;
     }
     class = vextract_string_c(VCDR(v));
+    /* opcode */
+    v = assqv(globals->constants.sym_opcode, spec);
+    if (VTAG(v) != cons) /* ? */
+      opcode = "";
+    else
+      opcode = vextract_string_c(VCDR(v));
     /* recipients */
     v = assqv(globals->constants.sym_recipients, spec);
     if (VTAG(v) != cons) {
@@ -839,7 +846,7 @@
 #endif /* INTERREALM */
 #endif
 
-       if (send_zgram_to_one(class, "", sender, instance, recipient,
+       if (send_zgram_to_one(class, opcode, sender, instance, recipient,
 			     message, message_len, auth) != 0)
 	  break;
        recip_list = VCDR(recip_list);
@@ -1165,6 +1172,7 @@
 
  fail:
    /* nothing to do */
+   return;
 }
 
 
@@ -1389,6 +1397,7 @@
    globals->constants.sym_register_query = vmake_symbol_c("register-query");
    globals->constants.sym_query = vmake_symbol_c("query");
    globals->constants.sym_id = vmake_symbol_c("id");
+   globals->constants.sym_opcode = vmake_symbol_c("opcode");
 }
 
 void
--- tzc-2.6.15.orig/tzc.1
+++ tzc-2.6.15/tzc.1
@@ -0,0 +1,74 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH TZC 1 "July 15, 2002"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+tzc \- trivial zephyr client
+.SH SYNOPSIS
+.B tzc
+.RI [ options ] 
+.SH DESCRIPTION
+.B Tzc
+is a zephyr client program which talks to the zephyr servers (via the
+"zephyr host manager") and to a gnu-emacs running zephyr-mode.
+.SH OPTIONS
+A summary of options is included below.
+.TP
+.BI \-a " nseconds"
+Restart tzc every 
+.I nseconds
+seconds.
+.TP
+.BI \-e " exposure"
+Set exposure.  (values: NONE, OPSTAFF, REALM-VISIBLE, REALM-ANNOUNCED, 
+NET-VISIBLE, NET-ANNOUNCED)
+.TP
+.BI \-l, " location"
+Set zlocation to the string
+.IR location .
+The default is tzc.n, where n is tzc's pid.
+.TP
+.BI \-p " filename"
+Write tzc's process-id to the file
+.IR filename .
+.TP
+.B \-s
+Use zctl for subscriptions (read from ~/zephyr.subs.tzc)
+.TP
+.BI \-t " nseconds"
+If no zephyrgrams arrive in
+.I nseconds
+seconds, send a test message to mkae sure we're alive.  If
+.I nseconds
+is zero, disable this feature.  Default is 300 seconds.
+.TP
+.B \-o
+Run tzc in output-only mode.  Tzc will just print zephyrgrams, and not
+accept commands from stdin
+.TP
+.B \-i
+Ignore eof on input
+.TP
+.B \-d
+Print debugging information.
+.SH SEE ALSO
+.BR zephyr (1),
+.BR zwgc (1),
+.BR zwrite (1),
+.BR zctl (1)
+.SH AUTHOR
+This manual page was written by Theodore Ts'o <tytso@mit.edu>,
+for the Debian GNU/Linux system (but may be used by others).
