diff -Nru tzc-2.6.15/debian/changelog tzc-2.6.15/debian/changelog --- tzc-2.6.15/debian/changelog 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/debian/changelog 2016-06-10 17:54:46.000000000 +0000 @@ -1,16 +1,36 @@ -tzc (2.6.15-5.3ubuntu1) xenial; urgency=medium +tzc (2.6.15-5.4) unstable; urgency=medium - * debian/rules: - - Remove legacy DH_COMPAT export. - - Add recommended build-arch and build-indep targets. - - Use dh_prep instead of dh_clean -k. - - Don't allow $(MAKE) clean to ignore errors. - * debian/compat: Indicate compatibility level of 9. + * Non-maintainer upload. + * Updated DH_LEVEL from 3 to 9. (Closes: #800220) * debian/control: - - Build-depend on debhelper (>= 9). - - Depend on ${misc:Depends}. + - Build-Depends field: + - debhelper >= 9. + - tzc Depends: + - ${misc:Depends} added. + * debian/dirs removed. + * debian/install created: + - using the file to install the command binary. + * dir debian/man created. + - to put tzc.1 in there. Was in tzc*.diff.gz. + * debian/manpages created. + * debian/patches: (quilt) + - split up tzc*.diff.gz archive. Three patch files.: + - add_ZCkAuth_file.patch. Create the ZCkAuth.c file completely. + - makefile-fixes.patch: + - to stop lintian about 'no-pie': + - add some options to CFLAGS. + - add $(CFLAGS) to tzc target. + - entries to install manpage and the command binary removed. + - fixes-tzc-c.patch. + - '%s' added to com_err(). Three times. Fernando Seiti Furusato + helped. + All patches needed 'quilt refresh --strip-trailing-whitespace'. + * debian/rules: + - new format + - hardening+=bidnow added. + - lines about debug and nostrip were removed. - -- Logan Rosen Tue, 22 Mar 2016 21:12:16 -0500 + -- Herbert Parentes Fortes Neto Fri, 10 Jun 2016 13:58:04 -0300 tzc (2.6.15-5.3) unstable; urgency=medium diff -Nru tzc-2.6.15/debian/control tzc-2.6.15/debian/control --- tzc-2.6.15/debian/control 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/debian/control 2016-06-07 18:46:44.000000000 +0000 @@ -1,8 +1,7 @@ Source: tzc Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Theodore Y. Ts'o +Maintainer: Theodore Y. Ts'o Build-Depends: debhelper (>= 9), libzephyr-dev (>= 3.0~beta), comerr-dev Standards-Version: 3.6.2.1 diff -Nru tzc-2.6.15/debian/dirs tzc-2.6.15/debian/dirs --- tzc-2.6.15/debian/dirs 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/debian/dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/bin -usr/share/man/man1 - diff -Nru tzc-2.6.15/debian/install tzc-2.6.15/debian/install --- tzc-2.6.15/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/install 2016-06-09 14:46:37.000000000 +0000 @@ -0,0 +1 @@ +tzc usr/bin diff -Nru tzc-2.6.15/debian/man/tzc.1 tzc-2.6.15/debian/man/tzc.1 --- tzc-2.6.15/debian/man/tzc.1 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/man/tzc.1 2016-06-07 17:02:52.000000000 +0000 @@ -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). diff -Nru tzc-2.6.15/debian/manpages tzc-2.6.15/debian/manpages --- tzc-2.6.15/debian/manpages 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/manpages 2016-06-07 18:36:03.000000000 +0000 @@ -0,0 +1 @@ +debian/man/tzc.1 diff -Nru tzc-2.6.15/debian/patches/add_ZCkAuth_file.patch tzc-2.6.15/debian/patches/add_ZCkAuth_file.patch --- tzc-2.6.15/debian/patches/add_ZCkAuth_file.patch 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/patches/add_ZCkAuth_file.patch 2016-06-07 20:21:17.000000000 +0000 @@ -0,0 +1,87 @@ +Description: Create the file completely +Reviewed-by: Herbert Parentes Fortes Neto +Last-Update: 2016-06-07 +Index: tzc-2.6.15/ZCkAuth.c +=================================================================== +--- /dev/null ++++ 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 ++} diff -Nru tzc-2.6.15/debian/patches/fixes-tzc-c.patch tzc-2.6.15/debian/patches/fixes-tzc-c.patch --- tzc-2.6.15/debian/patches/fixes-tzc-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/patches/fixes-tzc-c.patch 2016-06-10 17:39:54.000000000 +0000 @@ -0,0 +1,147 @@ +Description: Fixes applied previously +Reviewed-by: Herbert Parentes Fortes Neto + '%s' added to com_err(). Three times. +Last-update: 2016-06-07 +Index: tzc-2.6.15/tzc.c +=================================================================== +--- 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 @@ struct Globals { + Value *sym_register_query; + Value *sym_query; + Value *sym_id; ++ Value *sym_opcode; + } constants; + }; + +@@ -386,7 +387,7 @@ Code_t check(Code_t e, char *s) { + if (e) { + printf(";;; return code %d\n",(int) e); + fflush(stdout); +- com_err(__FILE__, e, s); ++ com_err(__FILE__, e, "%s", s); + bail(1); + } + return e; +@@ -394,7 +395,7 @@ Code_t check(Code_t e, char *s) { + + Code_t warn(Code_t e, char *s) { + if (e) +- com_err(__FILE__, e, s); ++ com_err(__FILE__, e, "%s", s); + return e; + } + +@@ -492,7 +493,7 @@ void subscribe_with_zctl() { + 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 @@ emacs_error(char *err) + 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]; +@@ -709,7 +710,7 @@ send_zgram_to_one(char *class, char *opc + if ((retval = ZSendNotice(¬ice, auth)) != ZERR_NONE) { + (void) sprintf(bfr, "while sending notice to %s", + notice.z_recipient); +- com_err(__FILE__, retval, bfr); ++ com_err(__FILE__, retval, "%s", bfr); + /* XXX should probably free instance & recipient here */ + return 1; + } else { +@@ -733,7 +734,7 @@ send_zgram(Value *spec) + 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 @@ send_zgram(Value *spec) + 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 @@ send_zgram(Value *spec) + #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 @@ handle_set_location(Value *setloc_cmd) + + fail: + /* nothing to do */ ++ return; + } + + +@@ -1369,7 +1377,9 @@ setup(int use_zctl) + globals->ebuf = (char *) malloc(globals->ebufsiz); + globals->ebufptr = globals->ebuf; + +- reset_heartbeat(); ++ if (globals->heartbeat.status != HB_DISABLED) { ++ reset_heartbeat(); ++ } + + globals->pending_replies = NULL; + +@@ -1389,6 +1399,7 @@ setup(int use_zctl) + 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 +@@ -1605,7 +1616,9 @@ report_zgram(ZNotice_t *notice, int auth + } + + /* zephyr server is still talking to us, so reset the heartbeat */ +- reset_heartbeat(); ++ if (globals->heartbeat.status != HB_DISABLED) { ++ reset_heartbeat(); ++ } + + /* if this is a heartbeat zgram, don't report it */ + if (!strcasecmp(notice->z_class, TZC_HEARTBEAT_CLASS) && +@@ -2003,6 +2016,7 @@ int main(int argc, char *argv[]) { + globals->heartbeat.period = atoi(optarg); + if (globals->heartbeat.period == 0) + globals->heartbeat.status = HB_DISABLED; ++ break; + case 'd': + globals->debug = 1; + break; diff -Nru tzc-2.6.15/debian/patches/makefile-fixes.patch tzc-2.6.15/debian/patches/makefile-fixes.patch --- tzc-2.6.15/debian/patches/makefile-fixes.patch 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/patches/makefile-fixes.patch 2016-06-10 17:36:18.000000000 +0000 @@ -0,0 +1,57 @@ +Description: Fixes applied previously +Reviewed-by: Herbert Parentes Fortes Neto + add some options to CFLAGS and add $(CFLAGS) to tzc target + entries to install manpage and the command binary removed +Last-update: 2016-06-07 +Index: tzc-2.6.15/Makefile +=================================================================== +--- 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,19 +17,27 @@ MISC_LIBS = + # 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) + + DEFINES = -DINTERREALM + INCLUDES = $(ZEPHYR_INCLUDES) $(KERB_INCLUDES) $(MISC_CFLAGS) +-CFLAGS = -g -O -Wall $(DEFINES) $(INCLUDES) ++CFLAGS = -g -O -Wall $(DEFINES) $(INCLUDES) -fPIE -pie -O2 -fstack-protector-strong -Wformat -Werror=format-security + + 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) $(CFLAGS) $(LDFLAGS) -o tzc.new $(OBJS) $(LIBS) + /bin/mv tzc.new tzc + ++#install: tzc ++# install tzc $(DESTDIR)/usr/bin ++ + lread.o: lread.h + tzc.o: lread.h + diff -Nru tzc-2.6.15/debian/patches/series tzc-2.6.15/debian/patches/series --- tzc-2.6.15/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/patches/series 2016-06-07 18:20:10.000000000 +0000 @@ -0,0 +1,3 @@ +fixes-tzc-c.patch +makefile-fixes.patch +add_ZCkAuth_file.patch diff -Nru tzc-2.6.15/debian/rules tzc-2.6.15/debian/rules --- tzc-2.6.15/debian/rules 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/debian/rules 2016-06-10 16:56:58.000000000 +0000 @@ -1,84 +1,8 @@ #!/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 -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif +export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow -configure: configure-stamp - -configure-stamp: - dh_testdir - - -build: build-arch build-indep -build-arch: build-stamp -build-indep: 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_prep - 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 +%: + dh $@ diff -Nru tzc-2.6.15/debian/source/format tzc-2.6.15/debian/source/format --- tzc-2.6.15/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ tzc-2.6.15/debian/source/format 2016-06-07 18:31:36.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru tzc-2.6.15/Makefile tzc-2.6.15/Makefile --- tzc-2.6.15/Makefile 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/Makefile 2001-07-11 02:17:31.000000000 +0000 @@ -1,9 +1,12 @@ # Configure as appropriate. -#KERB_LIBS = -lkrb4 -ldes425 -lcom_err -ZEPHYR_LIBS = -lzephyr -lcom_err - -DESTDIR = +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 # You may need to use these to pick up some BSD'ish functions like flock(). # Linux needs MISC_LIBS = -lbsd @@ -17,11 +20,6 @@ # 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) @@ -31,14 +29,10 @@ LIBS = $(ZEPHYR_LIBS) $(KERB_LIBS) $(MISC_LIBS) -tzc: $(OBJS) - $(LD) $(LDFLAGS) -o tzc.new $(OBJS) $(LIBS) +tzc: tzc.o lread.o $(EXTRA_OBJS) + $(LD) $(LDFLAGS) -o tzc.new tzc.o lread.o $(EXTRA_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 diff -Nru tzc-2.6.15/tzc.1 tzc-2.6.15/tzc.1 --- tzc-2.6.15/tzc.1 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/tzc.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -.\" 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). diff -Nru tzc-2.6.15/tzc.c tzc-2.6.15/tzc.c --- tzc-2.6.15/tzc.c 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/tzc.c 2001-07-11 02:17:03.000000000 +0000 @@ -124,7 +124,7 @@ #include #include #include "lread.h" -#include +#include #if USE_LIBCS #include /* for snprintf */ #endif @@ -248,7 +248,6 @@ Value *sym_register_query; Value *sym_query; Value *sym_id; - Value *sym_opcode; } constants; }; @@ -493,7 +492,7 @@ if(!(pid = fork())) { char fn[1024]; sprintf(fn,"%s/.zephyr.subs.tzc",getenv("HOME")); - execlp(ZCTL_BINARY,"zctl","load",fn,(char *)0); + execlp(ZCTL_BINARY,"zctl","load",fn,0); perror("zctl exec"); fprintf(stderr,"Unable to load subscriptions.\n"); bail(0); @@ -641,7 +640,7 @@ reentry = 0; } -static void tzc_com_err_hook(const char *whoami, long errcode, +static void tzc_com_err_hook(const char *whoami, int errcode, const char *fmt, va_list ap) { char buf1[4096], errmsg[4096]; @@ -734,7 +733,7 @@ Value *recip_list; Value *message_list; int message_len; - char *message = 0, *class, *instance, *sender, *recipient, *opcode; + char *message = 0, *class, *instance, *sender, *recipient; /* emacs sends something of the form: * ((class . "MESSAGE") @@ -752,12 +751,6 @@ 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) { @@ -846,7 +839,7 @@ #endif /* INTERREALM */ #endif - if (send_zgram_to_one(class, opcode, sender, instance, recipient, + if (send_zgram_to_one(class, "", sender, instance, recipient, message, message_len, auth) != 0) break; recip_list = VCDR(recip_list); @@ -1172,7 +1165,6 @@ fail: /* nothing to do */ - return; } @@ -1377,9 +1369,7 @@ globals->ebuf = (char *) malloc(globals->ebufsiz); globals->ebufptr = globals->ebuf; - if (globals->heartbeat.status != HB_DISABLED) { - reset_heartbeat(); - } + reset_heartbeat(); globals->pending_replies = NULL; @@ -1399,7 +1389,6 @@ 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 @@ -1616,9 +1605,7 @@ } /* zephyr server is still talking to us, so reset the heartbeat */ - if (globals->heartbeat.status != HB_DISABLED) { - reset_heartbeat(); - } + reset_heartbeat(); /* if this is a heartbeat zgram, don't report it */ if (!strcasecmp(notice->z_class, TZC_HEARTBEAT_CLASS) && @@ -2016,7 +2003,6 @@ globals->heartbeat.period = atoi(optarg); if (globals->heartbeat.period == 0) globals->heartbeat.status = HB_DISABLED; - break; case 'd': globals->debug = 1; break; diff -Nru tzc-2.6.15/ZCkAuth.c tzc-2.6.15/ZCkAuth.c --- tzc-2.6.15/ZCkAuth.c 2016-06-13 01:32:21.000000000 +0000 +++ tzc-2.6.15/ZCkAuth.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* 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 -}