--- tzc-2.6.15.orig/ZCkAuth.c +++ tzc-2.6.15/ZCkAuth.c @@ -0,0 +1,79 @@ +/* Modifications for tzc by Darrell Kindred , 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 +#else +#include +#define ZAUTH_UNSET (-3) /* from internal.h */ +#include /* 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/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 + +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/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 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 , +for the Debian GNU/Linux system (but may be used by others). --- tzc-2.6.15.orig/tzc.c +++ tzc-2.6.15/tzc.c @@ -124,7 +124,7 @@ #include #include #include "lread.h" -#include +#include #if USE_LIBCS #include /* for snprintf */ #endif @@ -248,6 +248,7 @@ Value *sym_register_query; Value *sym_query; Value *sym_id; + Value *sym_opcode; } constants; }; @@ -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/debian/README.Debian +++ tzc-2.6.15/debian/README.Debian @@ -0,0 +1,10 @@ +tzc for Debian +-------------- + +This is pretty much the stock tzc from + + http://www-2.cs.cmu.edu/People/dkindred/zephyr-mode/tzc-2.6.15.tar.gz + +with a patch from Karl Ramm so that the zephyrgram can be sent with a +specified opcode. + --- tzc-2.6.15.orig/debian/rules +++ tzc-2.6.15/debian/rules @@ -0,0 +1,87 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=3 + + + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp + +configure-stamp: + dh_testdir + + +build: build-stamp + +build-stamp: + dh_testdir + # Add here commands to compile the package. + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up after the build process. + -$(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tzc. + $(MAKE) install DESTDIR=$(CURDIR)/debian/tzc + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs -n +# dh_installexamples +# dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + dh_installman tzc.1 +# dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- tzc-2.6.15.orig/debian/control +++ tzc-2.6.15/debian/control @@ -0,0 +1,14 @@ +Source: tzc +Section: net +Priority: optional +Maintainer: Theodore Y. Ts'o +Build-Depends: debhelper (>> 3.0.0), libzephyr-dev (>= 3.0~beta), comerr-dev +Standards-Version: 3.6.2.1 + +Package: tzc +Architecture: any +Depends: ${shlibs:Depends}, zephyr-clients +Description: Trivial Zephyr Client + tzc is a trivial zephyr client program which talks to the zephyr servers + (via the "zephyr host manager"). It is primarily used by the gnu-emacs + zephyr-mode package. --- tzc-2.6.15.orig/debian/copyright +++ tzc-2.6.15/debian/copyright @@ -0,0 +1,19 @@ +This package was debianized by Theodore Ts'o on +Mon, 15 Jul 2002 09:07:11 -0400. + +It was downloaded from: + + http://www-2.cs.cmu.edu/People/dkindred/zephyr-mode/tzc-2.6.15.tar.gz + +Upstream Author: Darrell Kindred + +Copyright: + +Copyright (C) 1992, 1993 Scott Draves (spot@cs.cmu.edu) +Copyright (C) 1994, 1995, 1996, 1998 Darrell Kindred (dkindred@cs.cmu.edu) + +You are free to distribute this software under the terms of +the GNU General Public License. + +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL. --- tzc-2.6.15.orig/debian/changelog +++ tzc-2.6.15/debian/changelog @@ -0,0 +1,50 @@ +tzc (2.6.15-5.1) unstable; urgency=low + + * Non-maintainer upload. + * Build depend on zephyr 3.0, indicating a transition from krb4 to krb5 + zephyr, Closes: #538052 + + -- Sam Hartman Thu, 23 Jul 2009 07:42:27 -0400 + +tzc (2.6.15-5) unstable; urgency=low + + * Fix FTBFS with gcc 3.4. (Closes: #264445) + * Fix minor prototype mismatch. + * Fix linitian warnings and update Debian standards 3.6.2.1 + + -- Theodore Y. Ts'o Sat, 24 Sep 2005 20:46:29 -0400 + +tzc (2.6.15-4) unstable; urgency=low + + * We were depending on the version of com_err.h that was provided by + Kerberos; but since we've removed that from the build-depends line, + this broke the on the autobuilders. (Closes: #171856) + + -- Theodore Y. Ts'o Thu, 5 Dec 2002 13:01:05 -0500 + +tzc (2.6.15-3) unstable; urgency=low + + * Remove explicit mention of Kerberos libraries on the link line, + since libzephyr3-krb will automatically pull in the kerberos libraries + if necessary. (Closes: #153783) + * Removed ZckAuth.c hack since it adds a Kerberos dependency, and + doesn't always work. + * Apply patch from Karl Ramm to specify an opcode when sending a zgram. + + -- Theodore Y. Ts'o Tue, 3 Dec 2002 15:38:16 -0500 + +tzc (2.6.15-2) unstable; urgency=low + + * Minor fixups pointed out by Sam Hartman before making it ready for + initial upload. (Closes: #153079) + * Add build dependency on libzephyr-dev and comerr-dev, and + remove references to /usr/local in the Makefile. + + -- Theodore Y. Ts'o Mon, 15 Jul 2002 16:10:52 -0400 + +tzc (2.6.15-1) unstable; urgency=low + + * Initial Release. + + -- Theodore Y. Ts'o Mon, 15 Jul 2002 09:07:11 -0400 + --- tzc-2.6.15.orig/debian/dirs +++ tzc-2.6.15/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/man/man1 +