adding zephyr-im master branch
This commit is contained in:
parent
61f5ed8f01
commit
ee1236fa5c
14
.gitattributes
vendored
Normal file
14
.gitattributes
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
*.c ident
|
||||||
|
*.h ident
|
||||||
|
*.y ident
|
||||||
|
*.et ident
|
||||||
|
*.ct ident
|
||||||
|
*.py ident
|
||||||
|
*.1.in ident
|
||||||
|
*.1 ident
|
||||||
|
*.8.in ident
|
||||||
|
*.8 ident
|
||||||
|
debian export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
.gitattributes export-ignore
|
||||||
|
release export-ignore
|
89
.gitignore
vendored
Normal file
89
.gitignore
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
*~
|
||||||
|
.\#*
|
||||||
|
\#*#
|
||||||
|
autom4te.cache
|
||||||
|
TAGS
|
||||||
|
*.pyc
|
||||||
|
/build-stamp
|
||||||
|
/debian/files
|
||||||
|
/debian/*.substvars
|
||||||
|
/debian/*.debhelper.log
|
||||||
|
/configure-stamp
|
||||||
|
/debian/libzephyr-dev/*
|
||||||
|
/debian/*.debhelper
|
||||||
|
/debian/libzephyr-python/*
|
||||||
|
/debian/libzephyr4-krb/*
|
||||||
|
/debian/libzephyr4-krb45/*
|
||||||
|
/debian/libzephyr4-krb5/*
|
||||||
|
/debian/libzephyr4/*
|
||||||
|
/debian/tmp-krb5/*
|
||||||
|
/debian/tmp/*
|
||||||
|
/debian/zephyr-clients/*
|
||||||
|
/debian/zephyr-server-krb/*
|
||||||
|
/debian/zephyr-server-krb45/*
|
||||||
|
/debian/zephyr-server-krb5.README.Debian
|
||||||
|
/debian/zephyr-server-krb5.docs
|
||||||
|
/debian/zephyr-server-krb5.files
|
||||||
|
/debian/zephyr-server-krb5.postinst
|
||||||
|
/debian/zephyr-server-krb5.postrm
|
||||||
|
/debian/zephyr-server-krb5.templates
|
||||||
|
/debian/zephyr-server-krb5/*
|
||||||
|
/debian/zephyr-server/*
|
||||||
|
/krb5/*
|
||||||
|
/no-krb/*
|
||||||
|
/debian/libzephyr4-krb5.files
|
||||||
|
aclocal.m4
|
||||||
|
configure
|
||||||
|
h/config.h.in
|
||||||
|
ltmain.sh
|
||||||
|
m4
|
||||||
|
config.guess
|
||||||
|
config.sub
|
||||||
|
libtool
|
||||||
|
install-sh
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
*.o
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
/lib/zephyr_err.c
|
||||||
|
/lib/zephyr_err.h
|
||||||
|
/server/zsrv_err.c
|
||||||
|
/server/zsrv_err.h
|
||||||
|
.libs
|
||||||
|
Makefile
|
||||||
|
/server/test_server
|
||||||
|
/server/zephyrd
|
||||||
|
/server/zephyrd.8
|
||||||
|
/zhm/zhm
|
||||||
|
/zhm/zhm.8
|
||||||
|
/zwgc/char_stack.h
|
||||||
|
/zwgc/int_dictionary.c
|
||||||
|
/zwgc/int_dictionary.h
|
||||||
|
/zwgc/pointer_dictionary.c
|
||||||
|
/zwgc/pointer_dictionary.h
|
||||||
|
/zwgc/port_dictionary.c
|
||||||
|
/zwgc/port_dictionary.h
|
||||||
|
/zwgc/string_dictionary.c
|
||||||
|
/zwgc/string_dictionary.h
|
||||||
|
/zwgc/string_stack.h
|
||||||
|
/zwgc/unsigned_long_dictionary.c
|
||||||
|
/zwgc/unsigned_long_dictionary.h
|
||||||
|
/zwgc/xmode_stack.h
|
||||||
|
/zwgc/y.tab.c
|
||||||
|
/zwgc/y.tab.h
|
||||||
|
/zwgc/zwgc
|
||||||
|
/zwgc/zwgc.1
|
||||||
|
/clients/zaway/zaway
|
||||||
|
/clients/zctl/zctl
|
||||||
|
/clients/zctl/zctl.1
|
||||||
|
/clients/zctl/zctl_cmds.c
|
||||||
|
/clients/zleave/zleave
|
||||||
|
/clients/zlocate/zlocate
|
||||||
|
/clients/znol/znol
|
||||||
|
/clients/zshutdown_notify/zshutdown_notify
|
||||||
|
/clients/zstat/zstat
|
||||||
|
/clients/zwrite/zwrite
|
||||||
|
/h/config.h
|
||||||
|
/h/zephyr/zephyr_err.h
|
||||||
|
/h/zephyr_version.h
|
78
INSTALL
Normal file
78
INSTALL
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
This file explains how to build and install Zephyr on a machine. To
|
||||||
|
learn how to use Zephyr once you've installed it, read the file USING.
|
||||||
|
To learn how to set up Zephyr service at a site, read the file
|
||||||
|
OPERATING.
|
||||||
|
|
||||||
|
To build and install Zephyr, run:
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
This will build Zephyr without Hesiod or Kerberos support, and install
|
||||||
|
in /usr/local. To install in a location other than /usr/local, add
|
||||||
|
"--prefix=INSTPREFIX" to the configure line, where INSTPREFIX is the
|
||||||
|
directory you want to install Zephyr in.
|
||||||
|
|
||||||
|
If your site has a Hesiod service with a valid zephyr.sloc entry (or
|
||||||
|
you can add one), you can enable Hesiod support by adding the option
|
||||||
|
"--with-hesiod=HESPREFIX" to the configure line, where
|
||||||
|
HESPREFIX/include and HESPREFIX/lib are the directories you have the
|
||||||
|
Hesiod libraries installed in.
|
||||||
|
|
||||||
|
If your site has a Kerberos 5 service, you can enable Kerberos 5 support
|
||||||
|
by adding the option "--with-krb5=KRBPREFIX" to the configure line,
|
||||||
|
where KRBPREFIX/include and KRBPREFIX/lib are the directories you
|
||||||
|
have the Kerberos libraries installed in.
|
||||||
|
|
||||||
|
If your site has a Kerberos 4 service, you can enable Kerberos 4 support
|
||||||
|
by adding the option "--with-krb4=KRBPREFIX" to the configure line,
|
||||||
|
where KRBPREFIX/include and KRBPREFIX/lib are the directories you
|
||||||
|
have the Kerberos libraries installed in. Note that this is
|
||||||
|
deprecated, and should only be enabled for transitions.
|
||||||
|
|
||||||
|
If you build with both krb5 and krb4, you will get a client that only
|
||||||
|
knows how to authenticate with krb5 servers, but a server that can
|
||||||
|
understand authentication from both krb4 and krb5 clients.
|
||||||
|
|
||||||
|
If you want/need a krb4 client, you have to build without krb5.
|
||||||
|
|
||||||
|
If you have a make which supports VPATH in a manner compatible with
|
||||||
|
GNU make, you can build in a separate directory. Simply invoke the
|
||||||
|
configure script from within the build directory and configure will
|
||||||
|
locate the source directory for you. (If that doesn't work for some
|
||||||
|
reason, you can also specify "--srcdir=SOURCEDIR" on the configuration
|
||||||
|
line.)
|
||||||
|
|
||||||
|
If configure can't properly find your X11 include or library
|
||||||
|
directories, add "--x-includes=INCDIR" and "--x-libraries=LIBDIR" to
|
||||||
|
the configure line. To build without X11 support, add "--without-x"
|
||||||
|
to the configure line.
|
||||||
|
|
||||||
|
If you have Hesiod and/or Kerberos installed such that you can't
|
||||||
|
specify a single prefix for both include files and libraries, set the
|
||||||
|
environment variables CPPFLAGS and LDFLAGS to include the relevant
|
||||||
|
directories, and just configure with "--with-krb4" and
|
||||||
|
"--with-hesiod". For instance (for a csh-like shell):
|
||||||
|
|
||||||
|
setenv CPPFLAGS "-I/opt/athena/include"
|
||||||
|
setenv LDFLAGS "-I/opt/athena/arch/sparc/lib"
|
||||||
|
./configure --with-hesiod --with-krb4
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
Although it's not necessary for Zephyr to function correctly, you
|
||||||
|
should add the following services to /etc/services if possible:
|
||||||
|
|
||||||
|
zephyr-clt 2103/udp # Zephyr serv-hm connection
|
||||||
|
zephyr-hm 2104/udp # Zephyr hostmanager
|
||||||
|
zephyr-hm-srv 2105/udp # Zephyr hm-serv connection
|
||||||
|
|
||||||
|
To learn how to use Zephyr, read the file USING and the man pages for
|
||||||
|
the various Zephyr programs. To learn how to operate a Zephyr
|
||||||
|
service, read the file OPERATING.
|
||||||
|
|
||||||
|
We have tried to make Zephyr as portable as is reasonably possible,
|
||||||
|
but have not taken into account every possible kind of system. If you
|
||||||
|
have any problems building or installing Zephyr according to these
|
||||||
|
instructions, please go to http://zephyr.1ts.org and open a ticket.
|
65
Makefile.in
Normal file
65
Makefile.in
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
bindir=@bindir@
|
||||||
|
libdir=@libdir@
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
SUBDIRS=lib clients server zhm zwgc
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MAKE) all
|
||||||
|
|
||||||
|
h/zephyr_version.h: always
|
||||||
|
sh -x ${srcdir}/new_vers.sh $(top_srcdir)
|
||||||
|
|
||||||
|
clean: clean_version
|
||||||
|
|
||||||
|
clean_version:
|
||||||
|
$(RM) h/zephyr_version.h
|
||||||
|
|
||||||
|
all: h/zephyr_version.h
|
||||||
|
|
||||||
|
all check clean:
|
||||||
|
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
|
||||||
|
|
||||||
|
install:
|
||||||
|
${INSTALL} -d ${DESTDIR}${prefix}
|
||||||
|
${INSTALL} -d ${DESTDIR}${exec_prefix}
|
||||||
|
${INSTALL} -d ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${libdir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${libdir}/pkgconfig
|
||||||
|
${INSTALL} -d ${DESTDIR}${datadir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${datadir}/zephyr
|
||||||
|
${INSTALL} -d ${DESTDIR}${sysconfdir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${sysconfdir}/zephyr/acl
|
||||||
|
${INSTALL} -d ${DESTDIR}${sbindir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${includedir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${includedir}/zephyr
|
||||||
|
${INSTALL} -d ${DESTDIR}${mandir}
|
||||||
|
${INSTALL} -d ${DESTDIR}${mandir}/man1
|
||||||
|
${INSTALL} -d ${DESTDIR}${mandir}/man3
|
||||||
|
${INSTALL} -d ${DESTDIR}${mandir}/man8
|
||||||
|
${INSTALL} -m 644 ${srcdir}/h/zephyr/mit-copyright.h \
|
||||||
|
${DESTDIR}${includedir}/zephyr
|
||||||
|
${INSTALL} -m 644 ${srcdir}/h/zephyr/zephyr.h \
|
||||||
|
${DESTDIR}${includedir}/zephyr
|
||||||
|
${INSTALL} -m 644 zephyr.pc ${DESTDIR}${libdir}/pkgconfig
|
||||||
|
${INSTALL} -m 644 h/zephyr/zephyr_err.h ${DESTDIR}${includedir}/zephyr
|
||||||
|
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
|
||||||
|
|
||||||
|
always:
|
||||||
|
|
||||||
|
.PHONY: all build check install clean clean_version always
|
||||||
|
|
27
NOTES
Normal file
27
NOTES
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Please observe the following notes when making changes to the source
|
||||||
|
tree.
|
||||||
|
|
||||||
|
The directory h contains header files used internally in the zephyr
|
||||||
|
source tree. The directory h/zephyr contains header files containing
|
||||||
|
declarations for the Zephyr API. h/zephyr/zephyr_err.h is generated
|
||||||
|
from lib/zephyr/zephyr_err.et when lib/zephyr is built.
|
||||||
|
h/zephyr/zephyr.h is generated by configure, as is h/config.h. Those
|
||||||
|
header files live in the build tree. All other header files in h live
|
||||||
|
in the source tree.
|
||||||
|
|
||||||
|
h/config.h is generated by configure and contains the results of
|
||||||
|
configure tests as well as definitions for the installation
|
||||||
|
configuration directory and data directory. h/sysdep.h uses
|
||||||
|
h/config.h to include various header files or make various external
|
||||||
|
declarations which many programs might be interested in. h/internal.h
|
||||||
|
contains declarations internal to the "Zephyr system proper," which
|
||||||
|
includes the Zephyr library, the server, the hostmanager, and (for
|
||||||
|
now) zstat.
|
||||||
|
|
||||||
|
h/zephyr/zephyr.h is a public header file; that is, it is installed
|
||||||
|
with the Zephyr system. As such, this header file may need to work
|
||||||
|
with compilers other than the compiler used to build the Zephyr system
|
||||||
|
itself. Thus, we use __STDC__ (both in h/sysdep.h and in zephyr.h) to
|
||||||
|
guess whether the compiler will handle const, prototypes, and stdarg.
|
||||||
|
This is unfortunately not as reliable as using autoconf features like
|
||||||
|
AC_C_CONST.
|
58
OPERATING
Normal file
58
OPERATING
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
This file explains how to operate a Zephyr service once you have
|
||||||
|
installed Zephyr on all the relevant machines and file servers in your
|
||||||
|
environment. To learn how to configure, build, and install Zephyr,
|
||||||
|
read the file INSTALL.
|
||||||
|
|
||||||
|
To set up Zephyr service at a site, follow these steps:
|
||||||
|
|
||||||
|
1. Choose the machines you wish to have act as Zephyr servers at your
|
||||||
|
site. Expect the server to be CPU-efficient but to consume a bit more
|
||||||
|
memory than you might expect (at MIT, with around a thousand
|
||||||
|
simultaneous users, the Zephyr server's data size is 40MB). If you
|
||||||
|
have a lot of users, the server should have enough memory so that the
|
||||||
|
process doesn't swap.
|
||||||
|
|
||||||
|
2a. If you configured Zephyr with Hesiod support, make sure your
|
||||||
|
Hesiod realm has a "zephyr.sloc" entry containing a record for each
|
||||||
|
server. (Each entry should contain the name of the server, nothing
|
||||||
|
else.) The Zephyr servers will use the zephyr.sloc entry to find the
|
||||||
|
other servers. Host managers will use the zephyr.sloc entry to find
|
||||||
|
the Zephyr servers by default; however, you can control the set of
|
||||||
|
servers for each host manager by giving each host a
|
||||||
|
"<hostname>.cluster" entry containing a record "zcluster <serverset>".
|
||||||
|
If such a record is found, the host manager will resolve
|
||||||
|
"<serverset>.sloc" instead of "zephyr.sloc".
|
||||||
|
|
||||||
|
2b. If you configured Zephyr without Hesiod support, and you have
|
||||||
|
multiple Zephyr servers, each server should have a file "server.list"
|
||||||
|
in the configuration directory (which is /etc/athena/zephyr if you
|
||||||
|
configured with --enable-athena, or /usr/local/etc/zephyr if you
|
||||||
|
installed Zephyr in /usr/local and didn't use --enable-athena). This
|
||||||
|
file should contain a list of the servers, one per line. The server
|
||||||
|
will read and use this file if it exists even if the server was built
|
||||||
|
with hesiod support.
|
||||||
|
|
||||||
|
3. If you configured Zephyr with Kerberos 5 support, make a service
|
||||||
|
key "zephyr/zephyr@<your realm>" and install a keytab for that service
|
||||||
|
as "krb5.keytab" in the configuration directory of each of your zephyr
|
||||||
|
servers. Note that you need to ktadd the keytab only once and copy it
|
||||||
|
around; the files on all the servers should be identical.
|
||||||
|
|
||||||
|
4. Start zephyrd from the system binary directory (/usr/athena/etc if
|
||||||
|
you configured with --enable-athena, /usr/local/sbin if you installed
|
||||||
|
in /usr/local and didn't use --enable-athena). zephyrd logs as
|
||||||
|
service "local6"; watch the syslogs for error messages. Arrange for
|
||||||
|
zephyrd to be run at boot time on your server machines.
|
||||||
|
|
||||||
|
5. Each client machine should run zhm (the Zephyr Host Manager) from
|
||||||
|
the local system binary directory (/etc/athena for --enable-athena,
|
||||||
|
/usr/local/sbin if you installed in /usr/local and didn't use
|
||||||
|
--enable-athena). If you built Zephyr without Hesiod support, you
|
||||||
|
should start zhm as "zhm server1 server2 server3 ..." so that zhm
|
||||||
|
knows where the Zephyr servers are. Do not use "localhost" or
|
||||||
|
"127.0.0.1" as a server name, or zhm will become confused.
|
||||||
|
|
||||||
|
You can send a SIGFPE signal to the server process to make it dump its
|
||||||
|
subscription database to /var/tmp/zephyr.db. (If /var/tmp didn't
|
||||||
|
exist when Zephyr was built, the subscription database will be dumped
|
||||||
|
in /usr/tmp or /tmp instead.)
|
25
README.in
Normal file
25
README.in
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
This is version @VERSION@ of the Project Athena Zephyr
|
||||||
|
notification system.
|
||||||
|
|
||||||
|
Zephyr allows users to send messages to other users or to groups of
|
||||||
|
users. Users can view incoming Zephyr messages as windowgrams
|
||||||
|
(transient X windows) or as text on a terminal. Zephyr can optionally
|
||||||
|
make use of the Kerberos version 4 security library or the Hesiod
|
||||||
|
service name resolution library.
|
||||||
|
|
||||||
|
Bug reports or patches should go to bug-zephyr@mit.edu. Please do not
|
||||||
|
send questions about snapshots; they are not supported.
|
||||||
|
|
||||||
|
To find out how to configure, build, and install Zephyr, read the file
|
||||||
|
INSTALL.
|
||||||
|
|
||||||
|
To find out how to operate a Zephyr service, read the file OPERATING.
|
||||||
|
|
||||||
|
To find out how to use an existing Zephyr service, read the file
|
||||||
|
USING.
|
||||||
|
|
||||||
|
Please read the file NOTES before making any modifications to the
|
||||||
|
source tree.
|
||||||
|
|
||||||
|
--Karl Ramm
|
||||||
|
http://zephyr.1ts.org/
|
77
USING
Normal file
77
USING
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
This file explains how to use an existing Zephyr service once you've
|
||||||
|
built and installed the Zephyr distribution. To learn how to build
|
||||||
|
and install Zephyr, read the file INSTALL. To learn how to set up
|
||||||
|
Zephyr service at a site, read the file OPERATING.
|
||||||
|
|
||||||
|
First, before you can do anything else, your client machine must be
|
||||||
|
running zhm from the local system binary directory (/etc/athena/zephyr
|
||||||
|
if you built Zephyr with --enable-athena, /usr/local/sbin/zephyr if
|
||||||
|
you installed Zephyr in /usr/local and didn't use --enable-athena).
|
||||||
|
Only one copy of zhm can be running on a given machine, and it can be
|
||||||
|
started by any user. If you're using a machine you don't administer,
|
||||||
|
you may want to check if the machine is configured to start up zhm
|
||||||
|
automatically at boot time.
|
||||||
|
|
||||||
|
Once you have zhm running, you can start receiving zephyrgrams by
|
||||||
|
running the command:
|
||||||
|
|
||||||
|
zwgc
|
||||||
|
|
||||||
|
"zwgc" stands for "Zephyr WindowGram Client". If you built Zephyr
|
||||||
|
with X support and are using an X display, you will receive messages
|
||||||
|
as windows on your screen (click on them to get rid of them);
|
||||||
|
otherwise, you will receive messages in your terminal as text. Read
|
||||||
|
the man page on zwgc to find out how to configure it using the
|
||||||
|
.zwgc.desc file in your home directory.
|
||||||
|
|
||||||
|
You can send messages to another user with:
|
||||||
|
|
||||||
|
zwrite username
|
||||||
|
|
||||||
|
To write to groups of users, you must agree on a "class" and/or
|
||||||
|
"instance" to write to (this will be explained in greater detail
|
||||||
|
below). At MIT, most users communicate in private groups via classes.
|
||||||
|
Suppose a bunch of people wanted to communicate on a class "newclass".
|
||||||
|
They would all subscribe to the class with the command:
|
||||||
|
|
||||||
|
zctl add newclass \* \*
|
||||||
|
|
||||||
|
and send messages with:
|
||||||
|
|
||||||
|
zwrite -c newclass
|
||||||
|
|
||||||
|
The "zctl add" command adds the subscription to the .zephyr.subs file
|
||||||
|
in your home directory, so that you will automatically be subscribed
|
||||||
|
to the class the next time you run zwgc. If you just want to
|
||||||
|
subscribe without adding the subscription to your .zephyr.subs file,
|
||||||
|
use "zctl sub" instead of "zctl add".
|
||||||
|
|
||||||
|
Now for a bit more explanation about what classes and instances are:
|
||||||
|
every Zephyr message is send to a class, an instance, and a recipient,
|
||||||
|
commonly written as <class,instance,recipient>. The default class is
|
||||||
|
"MESSAGE"; the default instance is "PERSONAL". When you use "zwrite
|
||||||
|
username", you are sending a message to <MESSAGE,PERSONAL,username>.
|
||||||
|
If you don't specify a username on the zwrite command line, you will
|
||||||
|
be sending to the recipient "*", so when you use "zwrite -c newclass",
|
||||||
|
you are sending a message to <newclass,PERSONAL,*>.
|
||||||
|
|
||||||
|
Similarly, every time you request a subscription, you are subscribing
|
||||||
|
to a class, an instance, and a recipient. The recipient must be
|
||||||
|
either "*" or your username. The instance can be any string; however,
|
||||||
|
if you subscribe to instance "*", you will receive messages to any
|
||||||
|
instance as long as the class and recipient also match. The class can
|
||||||
|
be any string; "*" has no special meaning for class names. When you
|
||||||
|
start zwgc, you are automatically subscribed to
|
||||||
|
<MESSAGE,PERSONAL,yourusername> and <MESSAGE,URGENT,yourusername> even
|
||||||
|
if you don't explicitly request those subscriptions.
|
||||||
|
|
||||||
|
As an example of how you might use these features, at MIT we have
|
||||||
|
several frequently-used instances of class MESSAGE, called
|
||||||
|
"white-magic", "help", "weather", "tmbg" and so forth. These are
|
||||||
|
commonly known as "public" instances because they are not intended to
|
||||||
|
exclude anyone. Users can subscribe to individual instances using
|
||||||
|
"zctl add message help \*", or they can subscribe to all of them at
|
||||||
|
once using "zctl add message \* \*". (If users do this, they can tell
|
||||||
|
zwgc to filter out messages from certain instances; see the man page
|
||||||
|
for zwgc.) If users want to have semi-private group conversations,
|
||||||
|
they use separate classes, as described earlier.
|
13
clients/Makefile.in
Normal file
13
clients/Makefile.in
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
SUBDIRS=zaway zctl zleave zlocate znol \
|
||||||
|
zshutdown_notify zstat zwrite
|
||||||
|
|
||||||
|
all:
|
||||||
|
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
|
||||||
|
|
||||||
|
check install clean:
|
||||||
|
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
56
clients/zaway/Makefile.in
Normal file
56
clients/zaway/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zaway.o
|
||||||
|
|
||||||
|
all: zaway
|
||||||
|
|
||||||
|
zaway: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zaway
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zaway ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zaway.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zaway
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
120
clients/zaway/zaway.1
Normal file
120
clients/zaway/zaway.1
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\" @(#)zaway.1 6.1 (MIT) 7/9/87
|
||||||
|
.\"
|
||||||
|
.TH ZAWAY 1 "July 1, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zaway \- tell other people via Zephyr that you aren't around
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zaway
|
||||||
|
[
|
||||||
|
.I OPTIONS
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.I FILE
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I zaway
|
||||||
|
provides a way for you to automatically send replies when other people
|
||||||
|
contact you using
|
||||||
|
.I zwrite(1). zaway
|
||||||
|
subscribes itself to class "MESSAGE", instance "*", so that it can
|
||||||
|
monitor your incoming messages. It does not affect the operation of any
|
||||||
|
other client receiving messages.
|
||||||
|
.I zaway
|
||||||
|
is typically run when you are leaving your terminal or display
|
||||||
|
temporarily.
|
||||||
|
.I zaway
|
||||||
|
usually never exits; when you return to your terminal you should type
|
||||||
|
the interrupt character (usually ^C) in order to make
|
||||||
|
.I zaway
|
||||||
|
exit.
|
||||||
|
.SS OPTIONS
|
||||||
|
.TP
|
||||||
|
.I "\-m STRING"
|
||||||
|
Use STRING as the body of the auto-reply message. Any message file
|
||||||
|
(specified on the command line or the default) is ignored.
|
||||||
|
.TP
|
||||||
|
.I "\-w"
|
||||||
|
Watch the invoking user's location status. If the user is locatable
|
||||||
|
anywhere, no auto-replies will be sent.
|
||||||
|
.TP
|
||||||
|
.I "\-h"
|
||||||
|
Displays a short usage message and exits.
|
||||||
|
.PP
|
||||||
|
.I zaway
|
||||||
|
uses a message file (which defaults
|
||||||
|
to $HOME/.away) to describe what reponses should be sent to which
|
||||||
|
senders. The general format of this file
|
||||||
|
is:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
>name
|
||||||
|
>name
|
||||||
|
message
|
||||||
|
>name
|
||||||
|
message
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
Any number of user names may be specified preceding the message to send
|
||||||
|
to those senders. If a user name appears more than once, the message will
|
||||||
|
be a concatenation of each of the appropriate messages. There are
|
||||||
|
two special names: "*" indicates that the following message should be
|
||||||
|
sent to all senders and "%" indicates that the following message should
|
||||||
|
only be sent if the user name has not matched yet.
|
||||||
|
.PP
|
||||||
|
If no file is specified,
|
||||||
|
and no default file can be found, the following message is returned:
|
||||||
|
.sp
|
||||||
|
.in +5
|
||||||
|
I'm sorry, but I am currently away from the terminal and am
|
||||||
|
not able to receive your message.
|
||||||
|
.in -5
|
||||||
|
.sp
|
||||||
|
If a user name does not match any of those listed in the file, and no
|
||||||
|
"*" or "%" field is specified, no return message is sent. All
|
||||||
|
messages are preceded by a signature "Automated reply:". To avoid
|
||||||
|
loops, messages are not sent in response to messages beginning with an
|
||||||
|
"Automated reply:" signature or sent by the same Kerberos principal as
|
||||||
|
the user running
|
||||||
|
.I zaway.
|
||||||
|
|
||||||
|
.SH SAMPLE FILE
|
||||||
|
.nf
|
||||||
|
>eichin
|
||||||
|
>tony
|
||||||
|
Hi there guys! I'm in the other room right now.
|
||||||
|
I'll be back in 5 minutes or so.
|
||||||
|
>jruser
|
||||||
|
Sorry, but I'm gone for the day...
|
||||||
|
>%
|
||||||
|
Hello...I'm not sure who you are. I'll be back soon,
|
||||||
|
though.
|
||||||
|
>*
|
||||||
|
This message comes to you compliments of zaway!
|
||||||
|
.fi
|
||||||
|
|
||||||
|
The final "compliments" message will be included in all messages,
|
||||||
|
whereas the "I'm not sure" message will only be included in messages that
|
||||||
|
are not from "eichin", "tony", or "jruser".
|
||||||
|
.SH FILES
|
||||||
|
$HOME/.away
|
||||||
|
.SH SEE ALSO
|
||||||
|
zephyr(1), zwgc(1), zwrite(1), zhm(8), zephyrd(8)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
Robert S. French (MIT-Project Athena)
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
270
clients/zaway/zaway.c
Normal file
270
clients/zaway/zaway.c
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for the "zaway" command.
|
||||||
|
*
|
||||||
|
* Created by: Robert French
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987, 1993 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/mit-copyright.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid_zaway_c[] = "$Id$";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MESSAGE_CLASS "MESSAGE"
|
||||||
|
#define DEFAULT_MSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
|
||||||
|
#define RESPONSE_OPCODE ""
|
||||||
|
|
||||||
|
static char *find_message(ZNotice_t *, FILE *);
|
||||||
|
|
||||||
|
RETSIGTYPE cleanup(int);
|
||||||
|
u_short port;
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(char *name)
|
||||||
|
{
|
||||||
|
printf("Usage: %s [OPTIONS] [FILE]\n"
|
||||||
|
"\n"
|
||||||
|
" -m STRING use STRING as the body of the reply message\n"
|
||||||
|
" -w watch your location and only reply if you aren't locatable\n"
|
||||||
|
" -h display this help and exit\n",
|
||||||
|
name);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
FILE *fp;
|
||||||
|
ZNotice_t notice;
|
||||||
|
ZSubscription_t sub;
|
||||||
|
register int retval;
|
||||||
|
struct passwd *pw;
|
||||||
|
register char *ptr;
|
||||||
|
char awayfile[BUFSIZ],*msg[2],*envptr;
|
||||||
|
int optchar, watch_location;
|
||||||
|
char *cmdline_msg;
|
||||||
|
int nlocs;
|
||||||
|
char *charset = NULL;
|
||||||
|
unsigned short zcharset;
|
||||||
|
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
struct sigaction sa;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((retval = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"while initializing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
port = 0;
|
||||||
|
if ((retval = ZOpenPort(&port)) != ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"while opening port");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub.zsub_class = MESSAGE_CLASS;
|
||||||
|
sub.zsub_classinst = "*";
|
||||||
|
sub.zsub_recipient = ZGetSender();
|
||||||
|
|
||||||
|
cmdline_msg = 0;
|
||||||
|
watch_location = 0;
|
||||||
|
while ((optchar = getopt(argc, argv, "m:whx:")) != EOF) {
|
||||||
|
switch (optchar) {
|
||||||
|
case 'm':
|
||||||
|
cmdline_msg = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'w':
|
||||||
|
watch_location = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'h':
|
||||||
|
usage(argv[0]);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case 'x':
|
||||||
|
charset = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
fprintf(stderr,
|
||||||
|
"Unrecognized option '-%c'.\n"
|
||||||
|
"Try '%s -h' for more information.\n",
|
||||||
|
optopt, argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zcharset = ZGetCharset(charset);
|
||||||
|
|
||||||
|
if (argc > optind)
|
||||||
|
(void) strcpy(awayfile,argv[optind]);
|
||||||
|
else {
|
||||||
|
envptr = getenv("HOME");
|
||||||
|
if (envptr)
|
||||||
|
(void) sprintf(awayfile,"%s/.away",envptr);
|
||||||
|
else {
|
||||||
|
if (!(pw = getpwuid((int) getuid()))) {
|
||||||
|
fprintf(stderr,"Who are you?\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
(void) sprintf(awayfile,"%s/.away",pw->pw_dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fp = fopen(awayfile,"r");
|
||||||
|
if (!fp && argc > optind) {
|
||||||
|
fprintf(stderr,"File %s not found!\n",awayfile);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
(void) sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sa.sa_handler = cleanup;
|
||||||
|
(void) sigaction(SIGINT, &sa, (struct sigaction *)0);
|
||||||
|
(void) sigaction(SIGTERM, &sa, (struct sigaction *)0);
|
||||||
|
(void) sigaction(SIGHUP, &sa, (struct sigaction *)0);
|
||||||
|
#else
|
||||||
|
(void) signal(SIGINT, cleanup);
|
||||||
|
(void) signal(SIGTERM, cleanup);
|
||||||
|
(void) signal(SIGHUP, cleanup);
|
||||||
|
#endif
|
||||||
|
if ((retval = ZSubscribeToSansDefaults(&sub,1,port)) != ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"while subscribing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if ((retval = ZReceiveNotice(¬ice, (struct sockaddr_in *)0)) != ZERR_NONE) {
|
||||||
|
if (retval != ETIMEDOUT)
|
||||||
|
com_err(argv[0],retval,"while receiving notice");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(notice.z_sender,ZGetSender()) == 0 ||
|
||||||
|
strcmp(notice.z_opcode,"PING") == 0 ||
|
||||||
|
strcmp(notice.z_opcode,"AUTO") == 0 ||
|
||||||
|
strcmp(notice.z_message,"Automated reply:") == 0) {
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (watch_location) {
|
||||||
|
if ((retval = ZLocateUser(ZGetSender(), &nlocs, ZNOAUTH))
|
||||||
|
!= ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"while locating self");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nlocs != 0) {
|
||||||
|
/* User is logged in. Don't send an autoreply. */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZFlushLocations();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdline_msg) {
|
||||||
|
ptr = strdup(cmdline_msg);
|
||||||
|
if (!ptr) {
|
||||||
|
com_err(argv[0],ENOMEM,"while getting cmdline message");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (fp) {
|
||||||
|
if (!(ptr = find_message(¬ice,fp))) {
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ptr = malloc(sizeof(DEFAULT_MSG)+1);
|
||||||
|
if (!ptr) {
|
||||||
|
com_err(argv[0],ENOMEM,"while getting default message");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
(void) strcpy(ptr,DEFAULT_MSG);
|
||||||
|
}
|
||||||
|
notice.z_recipient = notice.z_sender;
|
||||||
|
notice.z_sender = 0;
|
||||||
|
notice.z_default_format = "";
|
||||||
|
notice.z_opcode = RESPONSE_OPCODE;
|
||||||
|
notice.z_charset = zcharset;
|
||||||
|
|
||||||
|
msg[0] = "Automated reply:";
|
||||||
|
msg[1] = ptr;
|
||||||
|
|
||||||
|
notice.z_message_len = strlen(notice.z_message)+1;
|
||||||
|
if ((retval = ZSendList(¬ice,msg,2,ZNOAUTH)) != ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"while sending notice");
|
||||||
|
}
|
||||||
|
free(ptr);
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
find_message(ZNotice_t *notice,
|
||||||
|
FILE *fp)
|
||||||
|
{
|
||||||
|
char *ptr,*ptr2;
|
||||||
|
char bfr[BUFSIZ],sender[BUFSIZ];
|
||||||
|
int gotone,lastwasnt;
|
||||||
|
|
||||||
|
rewind(fp);
|
||||||
|
|
||||||
|
(void) strcpy(sender,notice->z_sender);
|
||||||
|
ptr2 = strchr(sender,'@');
|
||||||
|
if (ptr2)
|
||||||
|
*ptr2 = '\0';
|
||||||
|
|
||||||
|
ptr = 0;
|
||||||
|
gotone = 0;
|
||||||
|
lastwasnt = 0;
|
||||||
|
|
||||||
|
while (fgets(bfr,sizeof bfr,fp) != (char *)0) {
|
||||||
|
if (*bfr == '>') {
|
||||||
|
if (lastwasnt)
|
||||||
|
gotone = 0;
|
||||||
|
bfr[strlen(bfr)-1] = '\0';
|
||||||
|
ptr2 = strchr(bfr,'@');
|
||||||
|
if (ptr2)
|
||||||
|
*ptr2 = '\0';
|
||||||
|
if (!strcmp(bfr+1,sender) ||
|
||||||
|
!strcmp(bfr+1,"*") ||
|
||||||
|
(!strcmp(bfr+1,"%") && !ptr))
|
||||||
|
gotone = 1;
|
||||||
|
lastwasnt = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (gotone) {
|
||||||
|
if (!ptr) {
|
||||||
|
ptr = malloc((unsigned)(strlen(bfr)+1));
|
||||||
|
*ptr = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ptr = realloc(ptr,(unsigned)(strlen(bfr)+strlen(ptr)+1));
|
||||||
|
(void) strcat(ptr,bfr);
|
||||||
|
}
|
||||||
|
lastwasnt = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
RETSIGTYPE
|
||||||
|
cleanup(int ignored)
|
||||||
|
{
|
||||||
|
ZCancelSubscriptions(port);
|
||||||
|
exit(1);
|
||||||
|
}
|
71
clients/zctl/Makefile.in
Normal file
71
clients/zctl/Makefile.in
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
editman = sed \
|
||||||
|
-e 's|@datadir[@]|${datadir}|g' \
|
||||||
|
-e 's|@sysconfdir[@]|${sysconfdir}|g' \
|
||||||
|
-e 's|@sbindir[@]|${sbindir}|g' \
|
||||||
|
-e 's|@lsbindir[@]|${lsbindir}|g'
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h @X_CFLAGS@ ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @SS_LIBS@ @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
SS_OBJS=zctl_cmds.o
|
||||||
|
OBJS= zctl.o @SS_OBJS@
|
||||||
|
|
||||||
|
all: zctl zctl.1
|
||||||
|
|
||||||
|
zctl: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
zctl_cmds.c: zctl_cmds.ct
|
||||||
|
mk_cmds ${srcdir}/zctl_cmds.ct
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
zctl.1: ${srcdir}/zctl.1.in Makefile
|
||||||
|
${editman} ${srcdir}/$@.in > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zctl zctl.1
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zctl ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 zctl.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zctl
|
||||||
|
rm -f ${OBJS} zctl_cmds.c
|
||||||
|
rm -f zctl.1
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
319
clients/zctl/zctl.1.in
Normal file
319
clients/zctl/zctl.1.in
Normal file
@ -0,0 +1,319 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\"
|
||||||
|
.TH ZCTL 1 "July 1, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zctl \- zephyr control program
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zctl
|
||||||
|
[
|
||||||
|
.I options
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Zctl
|
||||||
|
is a general purpose control program for the
|
||||||
|
.I Zephyr(1)
|
||||||
|
Notification Service. It allows the user to subscribe to specific
|
||||||
|
notice types, to save the subscriptions in a file (default
|
||||||
|
$HOME/.zephyr.subs), to change his location information, and to send
|
||||||
|
control messages to the HostManager,
|
||||||
|
.I zhm(8),
|
||||||
|
and the WindowGram client,
|
||||||
|
.I zwgc(1).
|
||||||
|
.PP
|
||||||
|
The commands may be typed on the command line, or may be entered
|
||||||
|
interactively by just typing
|
||||||
|
.I zctl
|
||||||
|
and then typing commands to the prompt.
|
||||||
|
.br
|
||||||
|
.B NOTE:
|
||||||
|
For all commands accepting an optional \fIrecipient\fR argument, the
|
||||||
|
\fIrecipient\fR defaults to your Kerberos principal. You may also
|
||||||
|
subscribe to recipient ``\fI*\fR''. If you specify a recipient, it is
|
||||||
|
silently converted to ``\fI*\fR''.
|
||||||
|
.br
|
||||||
|
The commands are as follows:
|
||||||
|
.TP 15
|
||||||
|
.B add \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Subscribe to \fIclass, instance, recipient\fR, and add this triplet to
|
||||||
|
the subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B add_unsubscription \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Unsubscribe to \fIclass, instance, recipient\fR, and add this triplet
|
||||||
|
to the subscriptions file as an un-subscription.
|
||||||
|
For an explanation of un-subscriptions, see below.
|
||||||
|
.TP
|
||||||
|
.B cancel
|
||||||
|
Cancel all subscriptions.
|
||||||
|
.TP
|
||||||
|
.B defaults
|
||||||
|
Retrieve the default subscription list from the Zephyr server.
|
||||||
|
.TP
|
||||||
|
.B delete \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Unsubscribe to \fIclass, instance, recipient\fR, and remove this triplet
|
||||||
|
from the subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B delete_unsubscription \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Unsubscribe to \fIclass, instance, recipient\fR, and remove this triplet
|
||||||
|
from the subscriptions file as an un-subscription.
|
||||||
|
.TP
|
||||||
|
.B file \fR[ \fIfile\fR ]
|
||||||
|
Set default subscriptions file to \fIfile\fR. If \fIfile\fR isn't specified,
|
||||||
|
show what the current subscriptions file is.
|
||||||
|
.TP
|
||||||
|
.B flush_locs \fR[ \fIuser\fR ]
|
||||||
|
Tell the Zephyr servers to flush all location information associated with
|
||||||
|
\fIuser\fR, or with the user running the command if none is given. This
|
||||||
|
should only be used to remove any incorrect data that may have been left
|
||||||
|
after a system crash. Note that only Operations staff may flush location
|
||||||
|
information associated with another user.
|
||||||
|
.TP
|
||||||
|
.B flush_subs \fR[ \fIrecipient\fR ]
|
||||||
|
Tell the Zephyr servers to flush all of \fIrecipient\fR's subscriptions,
|
||||||
|
This differs from the cancel command in that it affects subscriptions for
|
||||||
|
all of \fIrecipient\fR's clients. Note that only Operations staff may flush
|
||||||
|
the subscriptions of another user.
|
||||||
|
.TP
|
||||||
|
.B hide
|
||||||
|
Hide your location as maintained by the Zephyr server. This does not
|
||||||
|
affect the value of the exposure variable (see below, under
|
||||||
|
.B set).
|
||||||
|
.TP
|
||||||
|
.B hm_flush
|
||||||
|
Tell the HostManager,
|
||||||
|
.I zhm(8),
|
||||||
|
to ask the server to flush all state associated with the current host.
|
||||||
|
.TP
|
||||||
|
.B list \fR[ \fIfile\fR ]
|
||||||
|
List contents of current subscriptions file or
|
||||||
|
.I file.
|
||||||
|
Any macros in the file (see below) are displayed verbatim and not expanded.
|
||||||
|
.TP
|
||||||
|
.B list_requests
|
||||||
|
List all available commands. May be abbreviated by '?'.
|
||||||
|
.TP
|
||||||
|
.B load \fR[ \fIfile\fR ]
|
||||||
|
Subscribe to all subscription triplets and unsubscribe to all
|
||||||
|
un-subscription triplets in current subscriptions file or \fIfile\fR.
|
||||||
|
.TP
|
||||||
|
.B new_server
|
||||||
|
Tell the HostManager,
|
||||||
|
.I zhm(8),
|
||||||
|
to find a new Zephyr server.
|
||||||
|
.TP
|
||||||
|
.B quit
|
||||||
|
Exit from \fIzctl.
|
||||||
|
.TP
|
||||||
|
.B retrieve
|
||||||
|
Retrieve all current subscriptions from the Zephyr server. These include
|
||||||
|
subscriptions that might have been made by other programs, such as
|
||||||
|
.I znol(1).
|
||||||
|
.TP
|
||||||
|
.B save \fR[ \fIfile\fR ]
|
||||||
|
Save all current subscriptions (as returned by the Zephyr server)
|
||||||
|
into current subscriptions file or \fIfile\fR. The
|
||||||
|
file will be replaced.
|
||||||
|
.TP
|
||||||
|
.B set \fIvar\fR [ \fIvalue\fR ]
|
||||||
|
Set the value of Zephyr variable \fIvar\fR to \fIvalue\fR, or null if
|
||||||
|
no \fIvalue\fR is specified. The variable \fBexposure\fR has special
|
||||||
|
significance, and can only be set to the values none, opstaff, realm-visible,
|
||||||
|
realm-announced, net-visible, and net-announced. Setting this variable
|
||||||
|
immediately updates the information in the Zephyr servers (see below for
|
||||||
|
an explanation of the exposure levels). In addition,
|
||||||
|
setting this variable to none automatically performs the equivalent of a
|
||||||
|
.B wg_shutdown
|
||||||
|
command, and setting it to one of the other values automatically
|
||||||
|
performs the equivalent of a
|
||||||
|
.B wg_startup
|
||||||
|
command.
|
||||||
|
.br
|
||||||
|
The variable \fBresolved_addresses\fR determines whether zwgc will,
|
||||||
|
for an IP address indicating the origin of a message, attempt to look
|
||||||
|
up the hostname corresponding to that IP address. The value none
|
||||||
|
indicates that hostnames will never be found, and that the zwgc
|
||||||
|
fromhost variable will thus always contain an IP address (in
|
||||||
|
dotted-decimal form). The value all indicates that there will always
|
||||||
|
be an attempt to look up a hostname. Note that in this case, if you
|
||||||
|
have any subscriptions with recipient ``\fI*\fR'', these subscriptions
|
||||||
|
may be revealed to other Zephyr users who operate their own DNS name
|
||||||
|
servers. Any other value is interpreted as a regular expression;
|
||||||
|
hostname lookup attempts will occur only if the IP address matches
|
||||||
|
this regular expression.
|
||||||
|
.br
|
||||||
|
Any variable settings you make will be stored in \fI$HOME/.zephyr.vars\fR
|
||||||
|
.TP
|
||||||
|
.B show \fIvar\fR [ \fIvar\fR \ ... ]
|
||||||
|
Show the value of the specified Zephyr variables. If a variable is not
|
||||||
|
defined in the user's own variables file, the system variables file
|
||||||
|
(\fI@sysconfdir@/zephyr/zephyr.vars\fR) is searched for a default value.
|
||||||
|
.TP
|
||||||
|
.B subscribe \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Subscribe to \fIclass, instance, recipient\fR, but don't add this triplet to
|
||||||
|
the subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B unhide
|
||||||
|
Make your location as maintained by the Zephyr server visible. This does not
|
||||||
|
affect the value of the exposure variable.
|
||||||
|
.TP
|
||||||
|
.B unload \fR[ \fIfile\fR ]
|
||||||
|
Unsubscribe to all subscription triplets in current subscriptions file
|
||||||
|
or \fIfile\fR. Un-subscriptions in the file are ignored.
|
||||||
|
.TP
|
||||||
|
.B unset \fIvar\fR [ \fIvar\fR \ ... ]
|
||||||
|
Delete the definitions of the specified Zephyr variables.
|
||||||
|
.TP
|
||||||
|
.B unsubscribe \fIclass instance\fR [ \fIrecipient\fR ]
|
||||||
|
Unsubscribe to \fIclass, instance, recipient\fR, but don't remove this triplet
|
||||||
|
from the subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B wg_exit
|
||||||
|
Tell the WindowGram client,
|
||||||
|
.I zwgc(1),
|
||||||
|
to exit.
|
||||||
|
.TP
|
||||||
|
.B wg_read
|
||||||
|
Tell the WindowGram client,
|
||||||
|
.I zwgc(1),
|
||||||
|
to reread its description file.
|
||||||
|
.TP
|
||||||
|
.B wg_shutdown
|
||||||
|
Tell the WindowGram client to shutdown; this causes it to ignore all
|
||||||
|
notices until a wg_startup command is issued.
|
||||||
|
.TP
|
||||||
|
.B wg_startup
|
||||||
|
Tell the WindowGram client to start accepting notices again; useful
|
||||||
|
after a wg_shutdown command has been issued.
|
||||||
|
.SH MACROS and SUBSCRIPTION FILES
|
||||||
|
There are three macros,
|
||||||
|
.I %host%, %canon%, \fRand\fI %me%. %host%
|
||||||
|
is converted to the current hostname, \fI%canon%\fR is converted to the
|
||||||
|
official hostname as returned by
|
||||||
|
.I gethostbyname(3),
|
||||||
|
and \fI%me%\fR is converted to your Kerberos principal. These macros can be
|
||||||
|
used in your \fI$HOME/.zephyr.subs\fR file or as arguments to commands
|
||||||
|
to specify the
|
||||||
|
.I class
|
||||||
|
or
|
||||||
|
.I instance
|
||||||
|
fields. A sample \fI$HOME/.zephyr.subs\fR file might contain the following:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
message,urgent,%me%
|
||||||
|
syslog,%host%,*
|
||||||
|
mail,pop,%me%
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
.I Zctl
|
||||||
|
reads the environment variable \fBWGFILE\fR, to find the name of the
|
||||||
|
file where the windowgram port resides. If \fBWGFILE\fR is not set,
|
||||||
|
the file name defaults to /tmp/wg.\fIuid\fR, where \fIuid\fR is the
|
||||||
|
user's UNIX uid.
|
||||||
|
.SH UN-SUBSCRIPTIONS
|
||||||
|
The zephyr server,
|
||||||
|
.I zephyrd(8),
|
||||||
|
maintains default subscriptions which are automatically added to all
|
||||||
|
users' subscriptions at the time of their first subscription during a
|
||||||
|
login session. If you wish to automatically remove some of these
|
||||||
|
default subscriptions, you use
|
||||||
|
.B un-subscriptions.
|
||||||
|
When you
|
||||||
|
.B load
|
||||||
|
a subscription file containing
|
||||||
|
un-subscriptions, the un-subscriptions are automatically sent to the
|
||||||
|
server as if you had used the
|
||||||
|
.B unsubscribe
|
||||||
|
command.
|
||||||
|
.SH EXPOSURE LEVELS
|
||||||
|
The different exposure levels affect the operation of zephyr and its
|
||||||
|
interaction with the user, as follows:
|
||||||
|
.TP 10
|
||||||
|
.I none
|
||||||
|
This completely disables Zephyr for the user. The user is not
|
||||||
|
registered with Zephyr. No user location information is
|
||||||
|
retained by Zephyr. No login or logout announcements will be
|
||||||
|
sent. No subscriptions will be entered for the user, and no notices
|
||||||
|
will be displayed by
|
||||||
|
.I zwgc(1).
|
||||||
|
.TP
|
||||||
|
.I opstaff
|
||||||
|
The user is registered with Zephyr. No login or logout
|
||||||
|
announcements will be sent, and location information will only be
|
||||||
|
visible to Operations staff. Default subscriptions and any additional
|
||||||
|
personal subscriptions will be entered for the user.
|
||||||
|
.TP
|
||||||
|
.I realm-visible
|
||||||
|
The user is registered with Zephyr. User location information is retained by
|
||||||
|
Zephyr and made available only to users within the user's
|
||||||
|
Kerberos realm. No login or logout announcements will be sent. This
|
||||||
|
is the system default. Default subscriptions and any additional
|
||||||
|
personal subscriptions will be entered for the user.
|
||||||
|
.TP
|
||||||
|
.I realm-announced
|
||||||
|
The user is registered with Zephyr. User location information is retained by
|
||||||
|
Zephyr and made available only to users authenticated within the user's
|
||||||
|
Kerberos realm. Login and logout announcements will be sent, but only to
|
||||||
|
users within the user's Kerberos realm who have explicitly requested
|
||||||
|
such via subscriptions. Default subscriptions and any additional
|
||||||
|
personal subscriptions will be entered for the user.
|
||||||
|
.TP
|
||||||
|
.I net-visible
|
||||||
|
The user is registered with Zephyr. User location information is
|
||||||
|
retained by Zephyr and made available to any authenticated user who
|
||||||
|
requests such. Login and logout announcements will be sent only to users
|
||||||
|
within the user's Kerberos realm who have explicitly requested such via
|
||||||
|
subscriptions. Default subscriptions and any additional personal
|
||||||
|
subscriptions will be entered for the user.
|
||||||
|
.TP
|
||||||
|
.I net-announced
|
||||||
|
The user is registered with Zephyr. User location information is retained by
|
||||||
|
Zephyr and made available to any authenticated user who requests such. Login
|
||||||
|
and logout announcements will be sent to any user has requested such.
|
||||||
|
Default subscriptions and any additional personal
|
||||||
|
subscriptions will be entered for the user.
|
||||||
|
.SH EXAMPLES
|
||||||
|
.TP 25
|
||||||
|
.B zctl
|
||||||
|
Runs \fIzctl\fR in interactive mode.
|
||||||
|
.TP
|
||||||
|
.B zctl load
|
||||||
|
Load subscriptions and un-subscriptions from \fI$HOME/.zephyr.subs\fR file.
|
||||||
|
.TP
|
||||||
|
.B zctl sub message personal
|
||||||
|
Subscribe to personal messages, but don't add this to the
|
||||||
|
subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B zctl save
|
||||||
|
Save all current subscriptions to the default subscriptions file.
|
||||||
|
.TP
|
||||||
|
.B zctl set exposure none
|
||||||
|
Set your exposure level to `none', effectively turning off Zephyr.
|
||||||
|
.SH SEE ALSO
|
||||||
|
zephyr(1), zwgc(1), zhm(8), zephyrd(8)
|
||||||
|
gethostbyname(3)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH FILES
|
||||||
|
/tmp/wg.*
|
||||||
|
.br
|
||||||
|
$HOME/.zephyr.subs
|
||||||
|
.br
|
||||||
|
$ZEPHYR_VARS or $HOME/.zephyr.vars
|
||||||
|
.br
|
||||||
|
@sysconfdir@/zephyr/zephyr.vars
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
Robert S. French (MIT-Project Athena)
|
||||||
|
.sp
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
1391
clients/zctl/zctl.c
Normal file
1391
clients/zctl/zctl.c
Normal file
File diff suppressed because it is too large
Load Diff
101
clients/zctl/zctl_cmds.ct
Normal file
101
clients/zctl/zctl_cmds.ct
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
command_table zctl_cmds;
|
||||||
|
|
||||||
|
request set_file, "Set default subscriptions file.",
|
||||||
|
file;
|
||||||
|
|
||||||
|
request cancel_subs, "Cancel all subscriptions.",
|
||||||
|
cancel;
|
||||||
|
|
||||||
|
request load_subs, "Subscribe to a subscriptions file.",
|
||||||
|
load, ld;
|
||||||
|
|
||||||
|
request load_subs, "Unsubscribe to a subscriptions file.",
|
||||||
|
unload, unld;
|
||||||
|
|
||||||
|
request load_subs, "List a subscriptions file.",
|
||||||
|
list, ls;
|
||||||
|
|
||||||
|
request subscribe, "Subscribe to a class/class instance.",
|
||||||
|
subscribe, sub;
|
||||||
|
|
||||||
|
request subscribe, "Unsubscribe to a class/class instance.",
|
||||||
|
unsubscribe, unsub;
|
||||||
|
|
||||||
|
request sub_file, "Subscribe and add to subscriptions file.",
|
||||||
|
add;
|
||||||
|
|
||||||
|
request sub_file, "Unsubscribe and add to subscriptions file\n as un-subscription.",
|
||||||
|
add_unsubscription, add_un;
|
||||||
|
|
||||||
|
request sub_file, "Unsubscribe and delete subscription from\n subscriptions file.",
|
||||||
|
delete, del, dl;
|
||||||
|
request sub_file, "Delete un-subscription from subscriptions file.",
|
||||||
|
delete_unsubscription, del_un;
|
||||||
|
|
||||||
|
request current, "Retrieve current subscriptions.",
|
||||||
|
retrieve, ret;
|
||||||
|
|
||||||
|
request current, "Retrieve system-wide default subscriptions.",
|
||||||
|
defaults, defs;
|
||||||
|
|
||||||
|
request current, "Save current subscriptions (replacing existing file).",
|
||||||
|
save;
|
||||||
|
|
||||||
|
request show_var, "Show a variable's value.",
|
||||||
|
show;
|
||||||
|
|
||||||
|
request set_var, "Set a variable's value.",
|
||||||
|
set;
|
||||||
|
|
||||||
|
request unset_var, "Delete a variable's value.",
|
||||||
|
unset;
|
||||||
|
|
||||||
|
request wgc_control, "Get the WindowGram to reread its description file.",
|
||||||
|
wg_read;
|
||||||
|
|
||||||
|
request wgc_control, "Tell the WindowGram not to react to incoming notices.",
|
||||||
|
wg_shutdown;
|
||||||
|
|
||||||
|
request wgc_control, "Tell the WindowGram to react to incoming notices.",
|
||||||
|
wg_startup;
|
||||||
|
|
||||||
|
request wgc_control, "Tell the WindowGram to exit completely.",
|
||||||
|
wg_exit;
|
||||||
|
|
||||||
|
request hm_control, "Tell the server to flush information about this host.",
|
||||||
|
hm_flush;
|
||||||
|
|
||||||
|
request hm_control, "Tell the HostManager to find a new server.",
|
||||||
|
new_server;
|
||||||
|
|
||||||
|
request flush_locations, "Flush all location information.",
|
||||||
|
flush_locs;
|
||||||
|
|
||||||
|
request flush_subscr, "Flush all subscription information.",
|
||||||
|
flush_subs;
|
||||||
|
|
||||||
|
request do_hide, "Hide your location.",
|
||||||
|
hide;
|
||||||
|
|
||||||
|
request do_hide, "Show (un-hide) your location.",
|
||||||
|
unhide;
|
||||||
|
|
||||||
|
request ss_list_requests, "List available commands.",
|
||||||
|
list_requests, lr, "?";
|
||||||
|
|
||||||
|
request ss_quit, "Quit.",
|
||||||
|
quit, exit, q;
|
||||||
|
#ifdef CMU_ZCTL_PUNT
|
||||||
|
request do_punt, "Ignore specified messages.",
|
||||||
|
punt;
|
||||||
|
|
||||||
|
request do_punt, "Stop ignoring specified messages.",
|
||||||
|
unpunt;
|
||||||
|
|
||||||
|
request list_punts, "List current messages to ignore.",
|
||||||
|
list_punts, lp;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
end;
|
56
clients/zleave/Makefile.in
Normal file
56
clients/zleave/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zleave.o
|
||||||
|
|
||||||
|
all: zleave
|
||||||
|
|
||||||
|
zleave: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zleave
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zleave ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zleave.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zleave
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
107
clients/zleave/zleave.1
Normal file
107
clients/zleave/zleave.1
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright (c) 1980 Regents of the University of California.
|
||||||
|
.\" All rights reserved. The Berkeley software License Agreement
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\"
|
||||||
|
.TH ZLEAVE 1 "July 1, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zleave \- notify you via Zephyr when you have to leave
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zleave
|
||||||
|
[
|
||||||
|
.RI [+] hhmm
|
||||||
|
[
|
||||||
|
.I -m "Reminder Message"
|
||||||
|
] ]
|
||||||
|
.br
|
||||||
|
.B zleave
|
||||||
|
.I can\fR[\fIcel\fR]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Zleave
|
||||||
|
waits until the specified time, then reminds you that you
|
||||||
|
have to leave, using the \fIZephyr(1)\fR Notification Service.
|
||||||
|
You are reminded 5 minutes and 1 minute before the actual
|
||||||
|
time, at the time, and every minute thereafter.
|
||||||
|
When you log off,
|
||||||
|
.I zleave
|
||||||
|
exits just before it would have sent the next message.
|
||||||
|
.PP
|
||||||
|
The time of day is in the form hhmm where hh is a time in
|
||||||
|
hours (on a 12 or 24 hour clock).
|
||||||
|
All times are converted to a 12 hour clock, and assumed to
|
||||||
|
be in the next 12 hours.
|
||||||
|
.PP
|
||||||
|
If the time is preceded by `+', the alarm will go off in hours and minutes
|
||||||
|
from the current time.
|
||||||
|
.PP
|
||||||
|
If no argument is given,
|
||||||
|
.I zleave
|
||||||
|
prompts with "When do you
|
||||||
|
have to leave?". A reply of newline causes
|
||||||
|
.I zleave
|
||||||
|
to exit,
|
||||||
|
otherwise the reply is assumed to be a time.
|
||||||
|
This form is suitable for inclusion in a
|
||||||
|
.I .login
|
||||||
|
or
|
||||||
|
.I .profile.
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.I cancel
|
||||||
|
option cancels the currently running \fIzleave\fR. If another
|
||||||
|
.I zleave
|
||||||
|
is running, it is automatically killed when a new time to leave is
|
||||||
|
set. The process id is stored in the file /tmp/zleave.\fIuid\fR, where
|
||||||
|
\fIuid\fR is the user's UNIX uid.
|
||||||
|
.PP
|
||||||
|
If the
|
||||||
|
.I -m
|
||||||
|
argument is specified, the next argument
|
||||||
|
is appended to the standard message
|
||||||
|
(a sentence describing how much time remains until the appointed hour)
|
||||||
|
sent at appropriate times.
|
||||||
|
If you want to append a multiple-word message, you normally must quote it with
|
||||||
|
double quotes (") (This is necessary for users of
|
||||||
|
.IR csh (1)
|
||||||
|
and
|
||||||
|
.IR sh (1).)
|
||||||
|
.PP
|
||||||
|
.I Zleave
|
||||||
|
automatically subscribes you to Zephyr class "MESSAGE",
|
||||||
|
instance "LEAVE". You do not have to add anything to your
|
||||||
|
default subscriptions file (see
|
||||||
|
.IR zctl (1)).
|
||||||
|
The reminder message is displayed by the WindowGram client (usually
|
||||||
|
.IR zwgc (1)).
|
||||||
|
.PP
|
||||||
|
If Zephyr is unavailable,
|
||||||
|
.I zleave
|
||||||
|
acts essentially like
|
||||||
|
.IR leave (1).
|
||||||
|
.PP
|
||||||
|
Zleave ignores SIGINT, SIGQUIT, and SIGTERM.
|
||||||
|
To get rid of it you should either log off or use the
|
||||||
|
.I cancel
|
||||||
|
option.
|
||||||
|
.SH FILES
|
||||||
|
/tmp/zleave.\fIuid\fR
|
||||||
|
/tmp/wg.*
|
||||||
|
.SH SEE ALSO
|
||||||
|
calendar(1), zephyr(1), leave(1), zwgc(1), zctl(1), csh(1), sh(1)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1980, Regents of the University of California.
|
||||||
|
All rights reserved.
|
||||||
|
Redistribution and use in source and binary forms are permitted
|
||||||
|
provided that this notice is preserved and that due credit is given
|
||||||
|
to the University of California at Berkeley. The name of the University
|
||||||
|
may not be used to endorse or promote products derived from this
|
||||||
|
software without specific written prior permission. This software
|
||||||
|
is provided ``as is'' without express or implied warranty.
|
||||||
|
.sp
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
424
clients/zleave/zleave.c
Normal file
424
clients/zleave/zleave.c
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for the "zleave" command.
|
||||||
|
*
|
||||||
|
* Created by: David Jedlinsky
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/mit-copyright.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid_zlocate_c[] = "$Id$";
|
||||||
|
#endif /* lint */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1980 Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms are permitted
|
||||||
|
* provided that this notice is preserved and that due credit is given
|
||||||
|
* to the University of California at Berkeley. The name of the University
|
||||||
|
* may not be used to endorse or promote products derived from this
|
||||||
|
* software without specific written prior permission. This software
|
||||||
|
* is provided ``as is'' without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
char copyright[] =
|
||||||
|
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
|
||||||
|
All rights reserved.\n";
|
||||||
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#define MESSAGE_CLASS "MESSAGE"
|
||||||
|
#define INSTANCE "LEAVE"
|
||||||
|
/*
|
||||||
|
* zleave [[+]hhmm [ -m "Reminder Message" ]]
|
||||||
|
* or
|
||||||
|
* zleave can[cel]
|
||||||
|
*
|
||||||
|
* Reminds you when you have to leave.
|
||||||
|
* Leave prompts for input and goes away if you hit return.
|
||||||
|
* Messages are sent through Zephyr. Subscriptions are handled automagically.
|
||||||
|
* It nags you like a mother hen.
|
||||||
|
*/
|
||||||
|
char origlogin[20];
|
||||||
|
char tempfile[40];
|
||||||
|
char *whenleave;
|
||||||
|
char *reminder_message = NULL;
|
||||||
|
char buff[100];
|
||||||
|
int use_zephyr=1, oldpid;
|
||||||
|
|
||||||
|
void usage(void);
|
||||||
|
void doalarm(long);
|
||||||
|
void bother(long, char *);
|
||||||
|
void delay(long);
|
||||||
|
int gethm(char *, int *, int*);
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
time_t now;
|
||||||
|
long when, diff;
|
||||||
|
int hours, minutes;
|
||||||
|
char *cp;
|
||||||
|
FILE *fp;
|
||||||
|
struct tm *nv;
|
||||||
|
int port, c;
|
||||||
|
ZSubscription_t sub;
|
||||||
|
|
||||||
|
if (ZInitialize() != ZERR_NONE) {
|
||||||
|
fprintf(stderr,"No Zephyr! Will write directly to terminal.\n");
|
||||||
|
use_zephyr = 0;
|
||||||
|
}
|
||||||
|
(void) sprintf(tempfile, "/tmp/zleave.%d", (int) getuid());
|
||||||
|
|
||||||
|
if (use_zephyr) {
|
||||||
|
if ((port = ZGetWGPort()) == -1) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"Can't find WindowGram subscription port.\n");
|
||||||
|
fprintf(stderr,"Will write directly to terminal.\n");
|
||||||
|
use_zephyr = 0;
|
||||||
|
} else {
|
||||||
|
sub.zsub_class = MESSAGE_CLASS;
|
||||||
|
sub.zsub_classinst = INSTANCE;
|
||||||
|
sub.zsub_recipient = ZGetSender();
|
||||||
|
if (ZSubscribeToSansDefaults(&sub,1,(u_short)port)
|
||||||
|
!= ZERR_NONE) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"Subscription error! Writing to your terminal...\n");
|
||||||
|
use_zephyr = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!use_zephyr) {
|
||||||
|
if ((cp = getlogin()) == NULL) {
|
||||||
|
fputs("leave: You are not logged in.\n", stderr);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
(void) strcpy(origlogin, cp);
|
||||||
|
}
|
||||||
|
|
||||||
|
c = 1;
|
||||||
|
while ((c<argc) && (! reminder_message))
|
||||||
|
if (!strcmp(argv[c++],"-m")) {
|
||||||
|
if (argv[c])
|
||||||
|
reminder_message = argv[c];
|
||||||
|
else
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reminder_message)
|
||||||
|
reminder_message = "";
|
||||||
|
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("When do you have to leave? ");
|
||||||
|
(void) fflush(stdout);
|
||||||
|
buff[read(0, buff, sizeof buff)] = 0;
|
||||||
|
cp = buff;
|
||||||
|
} else
|
||||||
|
cp = argv[1];
|
||||||
|
if (*cp == '\n')
|
||||||
|
exit(0);
|
||||||
|
if (*cp == '+') {
|
||||||
|
cp++;
|
||||||
|
if (!gethm(cp, &hours, &minutes))
|
||||||
|
usage();
|
||||||
|
if (minutes < 0 || minutes > 59)
|
||||||
|
usage();
|
||||||
|
diff = 60*hours+minutes;
|
||||||
|
doalarm(diff);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
if (!strcmp(cp, "cancel") || !strcmp(cp, "can")) {
|
||||||
|
if (!(fp = fopen(tempfile,"r"))) {
|
||||||
|
printf("No zleave is currently running.\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
if (fscanf(fp, "%d", &oldpid) != 1) {
|
||||||
|
printf("The zleave pid file is corrupted.\n");
|
||||||
|
(void) fclose(fp);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
(void) fclose(fp);
|
||||||
|
if (kill(oldpid,9))
|
||||||
|
printf("No zleave is currently running.\n");
|
||||||
|
(void) unlink(tempfile);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
if (!gethm(cp, &hours, &minutes))
|
||||||
|
usage();
|
||||||
|
if (hours > 12)
|
||||||
|
hours -= 12;
|
||||||
|
if (hours == 12)
|
||||||
|
hours = 0;
|
||||||
|
|
||||||
|
if (hours < 0 || hours > 12 || minutes < 0 || minutes > 59)
|
||||||
|
usage();
|
||||||
|
|
||||||
|
(void) time(&now);
|
||||||
|
nv = localtime(&now);
|
||||||
|
when = 60*hours+minutes;
|
||||||
|
if (nv->tm_hour > 12)
|
||||||
|
nv->tm_hour -= 12; /* do am/pm bit */
|
||||||
|
now = 60 * nv->tm_hour + nv->tm_min;
|
||||||
|
diff = when - now;
|
||||||
|
while (diff < 0)
|
||||||
|
diff += 12*60;
|
||||||
|
if (diff > 11*60) {
|
||||||
|
fprintf(stderr, "That time has already passed!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
doalarm(diff);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
usage(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "usage: zleave [[+]hhmm [-m \"Reminder Message\"]]\n\
|
||||||
|
\tor: zleave can[cel]\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
gethm(char *cp,
|
||||||
|
int *hp,
|
||||||
|
int *mp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
int tod;
|
||||||
|
|
||||||
|
tod = 0;
|
||||||
|
while ((c = *cp++) != '\0') {
|
||||||
|
if (!isdigit(c))
|
||||||
|
return(0);
|
||||||
|
tod = tod * 10 + (c - '0');
|
||||||
|
}
|
||||||
|
*hp = tod / 100;
|
||||||
|
*mp = tod % 100;
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
doalarm(long nmins)
|
||||||
|
{
|
||||||
|
time_t daytime;
|
||||||
|
char *msg1, *msg2, *msg3, *msg4;
|
||||||
|
register int i;
|
||||||
|
long slp1, slp2, slp3, slp4;
|
||||||
|
long seconds, gseconds;
|
||||||
|
FILE *fp;
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
struct sigaction sa;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
seconds = 60 * nmins;
|
||||||
|
if (seconds <= 0)
|
||||||
|
seconds = 1;
|
||||||
|
gseconds = seconds;
|
||||||
|
|
||||||
|
msg1 = "You have to leave in 5 minutes";
|
||||||
|
if (seconds <= 60*5) {
|
||||||
|
slp1 = 0;
|
||||||
|
} else {
|
||||||
|
slp1 = seconds - 60*5;
|
||||||
|
seconds = 60*5;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg2 = "Just one more minute!";
|
||||||
|
if (seconds <= 60) {
|
||||||
|
slp2 = 0;
|
||||||
|
} else {
|
||||||
|
slp2 = seconds - 60;
|
||||||
|
seconds = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg3 = "Time to leave!";
|
||||||
|
slp3 = seconds;
|
||||||
|
|
||||||
|
msg4 = "You're going to be late!";
|
||||||
|
slp4 = 60L;
|
||||||
|
|
||||||
|
(void) time(&daytime);
|
||||||
|
daytime += gseconds;
|
||||||
|
whenleave = ctime(&daytime);
|
||||||
|
|
||||||
|
fp = fopen(tempfile,"r");
|
||||||
|
if (fp) {
|
||||||
|
if (fscanf(fp, "%d", &oldpid) == 1)
|
||||||
|
if (!kill(oldpid,9))
|
||||||
|
printf("Old zleave process killed.\n");
|
||||||
|
(void) fclose(fp);
|
||||||
|
}
|
||||||
|
printf("Alarm set for %s", whenleave);
|
||||||
|
|
||||||
|
/* Subscribe to MESSAGE.LEAVE here */
|
||||||
|
|
||||||
|
switch(fork()) {
|
||||||
|
case -1:
|
||||||
|
perror("fork");
|
||||||
|
exit(-1);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!(fp = fopen(tempfile, "w")))
|
||||||
|
fprintf(stderr, "Cannot open pid file.\n");
|
||||||
|
else {
|
||||||
|
fprintf(fp, "%d\n", getpid());
|
||||||
|
if (fclose(fp) == EOF)
|
||||||
|
(void) perror("fclose on pid file");
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sa.sa_handler = SIG_IGN;
|
||||||
|
sigaction(SIGINT, &sa, (struct sigaction *)0);
|
||||||
|
sigaction(SIGQUIT, &sa, (struct sigaction *)0);
|
||||||
|
sigaction(SIGTERM, &sa, (struct sigaction *)0);
|
||||||
|
sigaction(SIGTTOU, &sa, (struct sigaction *)0);
|
||||||
|
#else
|
||||||
|
(void) signal(SIGINT, SIG_IGN);
|
||||||
|
(void) signal(SIGQUIT, SIG_IGN);
|
||||||
|
(void) signal(SIGTERM, SIG_IGN);
|
||||||
|
(void) signal(SIGTTOU, SIG_IGN);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (slp1)
|
||||||
|
bother(slp1, msg1);
|
||||||
|
if (slp2)
|
||||||
|
bother(slp2, msg2);
|
||||||
|
bother(slp3, msg3);
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
bother(slp4, msg4);
|
||||||
|
|
||||||
|
bother(0L, "That was the last time I'll tell you. Bye.");
|
||||||
|
(void) unlink(tempfile);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bother(long slp,
|
||||||
|
char *msg)
|
||||||
|
{
|
||||||
|
ZNotice_t notice;
|
||||||
|
ZNotice_t retnotice;
|
||||||
|
int retval;
|
||||||
|
char *real_message;
|
||||||
|
|
||||||
|
delay(slp);
|
||||||
|
|
||||||
|
if (use_zephyr) {
|
||||||
|
real_message = (char *) malloc(strlen(msg) +
|
||||||
|
strlen(reminder_message) + 3);
|
||||||
|
if (real_message == NULL) {
|
||||||
|
fprintf (stderr, "zleave: out of memory\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
sprintf(real_message,"%c%s\n%s",'\0',msg,reminder_message);
|
||||||
|
|
||||||
|
(void) memset((char *)¬ice, 0, sizeof(notice));
|
||||||
|
notice.z_kind = ACKED;
|
||||||
|
notice.z_port = 0;
|
||||||
|
notice.z_charset = ZCHARSET_UNKNOWN;
|
||||||
|
notice.z_class = MESSAGE_CLASS;
|
||||||
|
notice.z_class_inst = INSTANCE;
|
||||||
|
notice.z_recipient = ZGetSender();
|
||||||
|
notice.z_opcode = "";
|
||||||
|
notice.z_sender = (char *) 0;
|
||||||
|
notice.z_default_format = "\n$2";
|
||||||
|
notice.z_message = real_message;
|
||||||
|
/* +3: initial null, newline, final null */
|
||||||
|
notice.z_message_len = strlen(msg)+strlen(reminder_message)+3;
|
||||||
|
|
||||||
|
if (ZSendNotice(¬ice, ZAUTH) != ZERR_NONE) {
|
||||||
|
printf("\7\7\7%s\n%s", msg, reminder_message);
|
||||||
|
use_zephyr = 0;
|
||||||
|
} else
|
||||||
|
if ((retval = ZIfNotice(&retnotice, (struct sockaddr_in *) 0,
|
||||||
|
ZCompareUIDPred,
|
||||||
|
(char *)¬ice.z_uid)) != ZERR_NONE) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"zleave: %s while waiting for acknowledgement\n",
|
||||||
|
error_message(retval));
|
||||||
|
use_zephyr = 0;
|
||||||
|
} else
|
||||||
|
if (retnotice.z_kind == SERVNAK) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"zleave: authorization failure while sending\n");
|
||||||
|
use_zephyr = 0;
|
||||||
|
} else
|
||||||
|
if (retnotice.z_kind != SERVACK || !retnotice.z_message_len) {
|
||||||
|
fprintf(stderr, "zleave: Detected server failure while receiving acknowledgement\n");
|
||||||
|
use_zephyr = 0;
|
||||||
|
} else
|
||||||
|
if (strcmp(retnotice.z_message, ZSRVACK_SENT)) {
|
||||||
|
/* it wasn't sent */
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
if (!use_zephyr)
|
||||||
|
exit(1);
|
||||||
|
ZFreeNotice(&retnotice);
|
||||||
|
free(real_message);
|
||||||
|
} else
|
||||||
|
#ifdef __STDC__
|
||||||
|
printf("\a\a\a%s\n%s", msg, reminder_message);
|
||||||
|
#else
|
||||||
|
printf("\7\7\7%s\n%s", msg, reminder_message);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* delay is like sleep but does it in 100 sec pieces and
|
||||||
|
* knows what zero means.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
delay(long secs)
|
||||||
|
{
|
||||||
|
long n;
|
||||||
|
register char *l;
|
||||||
|
|
||||||
|
while (secs > 0) {
|
||||||
|
n = 100;
|
||||||
|
if (secs < n)
|
||||||
|
n = secs;
|
||||||
|
secs -= n;
|
||||||
|
if (n > 0)
|
||||||
|
sleep((unsigned) n);
|
||||||
|
if (!use_zephyr) {
|
||||||
|
l = getlogin();
|
||||||
|
if (l == NULL)
|
||||||
|
exit(0);
|
||||||
|
if (strcmp(origlogin, l) != 0)
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_GETLOGIN
|
||||||
|
char *getlogin() {
|
||||||
|
#include <utmp.h>
|
||||||
|
|
||||||
|
static struct utmp ubuf;
|
||||||
|
int ufd;
|
||||||
|
|
||||||
|
ufd = open("/etc/utmp",0);
|
||||||
|
seek(ufd, ttyn(0)*sizeof(ubuf), 0);
|
||||||
|
read(ufd, &ubuf, sizeof(ubuf));
|
||||||
|
ubuf.ut_name[sizeof(ubuf.ut_name)] = 0;
|
||||||
|
return(&ubuf.ut_name);
|
||||||
|
}
|
||||||
|
#endif
|
56
clients/zlocate/Makefile.in
Normal file
56
clients/zlocate/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zlocate.o
|
||||||
|
|
||||||
|
all: zlocate
|
||||||
|
|
||||||
|
zlocate: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zlocate
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zlocate ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zlocate.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zlocate
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
76
clients/zlocate/zlocate.1
Normal file
76
clients/zlocate/zlocate.1
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\"
|
||||||
|
.TH ZLOCATE 1 "April 17, 1990" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zlocate \- find a user using Zephyr
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zlocate
|
||||||
|
[
|
||||||
|
.B -a
|
||||||
|
|
|
||||||
|
.B -d
|
||||||
|
] [
|
||||||
|
.B -1
|
||||||
|
] [
|
||||||
|
.B -p
|
||||||
|
] user ...
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Zlocate
|
||||||
|
uses the
|
||||||
|
.I Zephyr(1)
|
||||||
|
Notification Service to find where a user is currently logged in. If
|
||||||
|
the user is not logged in, or has set his location information such that
|
||||||
|
you do not have access to see it,
|
||||||
|
.I zlocate
|
||||||
|
prints "Hidden or not logged-in". Otherwise, each machine that the
|
||||||
|
user is currently logged into is printed, along with the time of
|
||||||
|
login and location. The location is usually the X window system display
|
||||||
|
name of the user's display, but may be the terminal name if he is not
|
||||||
|
using X or for some other reason is only using the terminal interface to
|
||||||
|
.I zwgc(1).
|
||||||
|
|
||||||
|
By default, all zlocate requests are authenticated using
|
||||||
|
.IR Kerberos .
|
||||||
|
If you do not have Kerberos tickets, or for some other reason do not
|
||||||
|
want to authenticate, the
|
||||||
|
.B -d
|
||||||
|
option will turn off authentication. The
|
||||||
|
.B -a
|
||||||
|
option is the default, authentication on.
|
||||||
|
|
||||||
|
When locating multiple users,
|
||||||
|
.I zlocate
|
||||||
|
will display the user name on a line by itself, followed by the locations for that user. To display the user name on the same line as the output, use the
|
||||||
|
.B -1
|
||||||
|
option (the numeral one).
|
||||||
|
|
||||||
|
To look up multiple users in parallel asynchronously, use the
|
||||||
|
.B -p
|
||||||
|
option.
|
||||||
|
|
||||||
|
.SH DIAGNOSTICS
|
||||||
|
.I zlocate
|
||||||
|
exits with status zero (0) if at least one user was found, and one (1)
|
||||||
|
if no users were found.
|
||||||
|
.SH SEE ALSO
|
||||||
|
zctl(1), zephyr(1), znol(1), zwgc(1), zhm(8), zephyrd(8), X(1)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH AUTHORS
|
||||||
|
.PP
|
||||||
|
Robert S. French (MIT-Project Athena)
|
||||||
|
.br
|
||||||
|
Marc Horowitz (MIT-Project Athena)
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
182
clients/zlocate/zlocate.c
Normal file
182
clients/zlocate/zlocate.c
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for the "zlocate" command.
|
||||||
|
*
|
||||||
|
* Created by: Robert French
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#if !defined(lint) && !defined(SABER)
|
||||||
|
static const char rcsid_zlocate_c[] = "$Id$";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int numusers=0, numleft=0, parallel=0, oneline=0;
|
||||||
|
char *whoami;
|
||||||
|
|
||||||
|
static RETSIGTYPE
|
||||||
|
timeout(int sig)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s: no response from server\n", whoami);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(void)
|
||||||
|
{
|
||||||
|
printf("Usage: %s [ -a | -d ] [ -p ] [ -1 ] user ... \n",whoami);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_locs(char *user,
|
||||||
|
int nlocs)
|
||||||
|
{
|
||||||
|
int one = 1, retval;
|
||||||
|
ZLocations_t locations;
|
||||||
|
|
||||||
|
if ((!oneline) && (numusers>1))
|
||||||
|
printf("\t%s:\n",user);
|
||||||
|
|
||||||
|
if ((!oneline) && (nlocs == 0))
|
||||||
|
printf("Hidden or not logged-in\n");
|
||||||
|
|
||||||
|
for (;nlocs;nlocs--) {
|
||||||
|
if ((retval = ZGetLocations(&locations,&one)) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"while getting location");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oneline) {
|
||||||
|
printf("%s:\t%s\t%s\t%s\n",user,locations.host,locations.tty,
|
||||||
|
locations.time);
|
||||||
|
} else {
|
||||||
|
printf("%-42s %-7s %s\n",locations.host, locations.tty, locations.time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!oneline) && (numusers > 1) && (numleft > 0))
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
|
int
|
||||||
|
main(int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
char user[BUFSIZ],*whichuser;
|
||||||
|
ZAsyncLocateData_t ald;
|
||||||
|
int retval,i,numlocs,numfound,loc,auth,rlen;
|
||||||
|
ZNotice_t notice;
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
struct sigaction sa;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
whoami = argv[0];
|
||||||
|
auth = -1;
|
||||||
|
|
||||||
|
argv++;
|
||||||
|
argc--;
|
||||||
|
|
||||||
|
for (i=0; i < argc; i++)
|
||||||
|
if (argv[i][0] == '-')
|
||||||
|
switch (argv[i][1]) {
|
||||||
|
case 'a':
|
||||||
|
if (auth != -1) usage();
|
||||||
|
auth = 1;
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
if (auth != -1) usage();
|
||||||
|
auth = 0;
|
||||||
|
break;
|
||||||
|
case 'p':
|
||||||
|
parallel = 1;
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
oneline = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
usage();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
numusers++;
|
||||||
|
|
||||||
|
if (numusers == 0)
|
||||||
|
usage();
|
||||||
|
|
||||||
|
if (auth == -1) auth = 1;
|
||||||
|
|
||||||
|
if ((retval = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"while initializing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
numleft = numusers;
|
||||||
|
numfound = 0;
|
||||||
|
rlen = strlen(ZGetRealm());
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
for (loc = 0; loc < argc; loc++) {
|
||||||
|
if (argv[loc][0] == '-') continue;
|
||||||
|
|
||||||
|
(void) strncpy(user,argv[loc],sizeof(user) - rlen - 2);
|
||||||
|
user[sizeof(user) - rlen - 2] = '\0';
|
||||||
|
if (!strchr(user,'@')) {
|
||||||
|
(void) strcat(user,"@");
|
||||||
|
(void) strcat(user,ZGetRealm());
|
||||||
|
}
|
||||||
|
if (parallel) {
|
||||||
|
if ((retval = ZRequestLocations(user, &ald, i ? UNSAFE : UNACKED,
|
||||||
|
auth?ZAUTH:ZNOAUTH)) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"requesting location of %s",user);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
i = 1;
|
||||||
|
} else {
|
||||||
|
if ((retval = ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH)) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"while locating user %s",user);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
print_locs(user,numlocs);
|
||||||
|
numfound += numlocs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parallel) {
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sa.sa_handler = timeout;
|
||||||
|
sigaction(SIGALRM, &sa, (struct sigaction *)0);
|
||||||
|
#else
|
||||||
|
signal (SIGALRM, timeout);
|
||||||
|
#endif
|
||||||
|
while (numleft-- > 0) {
|
||||||
|
alarm(SRV_TIMEOUT);
|
||||||
|
if ((retval = ZReceiveNotice(¬ice, NULL)) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"while searching notice queue");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((retval = ZParseLocations(¬ice, (ZAsyncLocateData_t *)NULL,
|
||||||
|
&numlocs, &whichuser)) != ZERR_NONE) {
|
||||||
|
com_err(whoami,retval,"while parsing locations");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (numlocs >= 0) {
|
||||||
|
print_locs(whichuser,numlocs);
|
||||||
|
free(whichuser);
|
||||||
|
numfound += numlocs;
|
||||||
|
}
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return((numfound > 0) ? 0 : 1);
|
||||||
|
}
|
56
clients/znol/Makefile.in
Normal file
56
clients/znol/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= znol.o
|
||||||
|
|
||||||
|
all: znol
|
||||||
|
|
||||||
|
znol: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: znol
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 znol ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/znol.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f znol
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
109
clients/znol/znol.1
Normal file
109
clients/znol/znol.1
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\" @(#)znol.1 6.1 (MIT) 7/9/87
|
||||||
|
.\"
|
||||||
|
.TH ZNOL 1 "July 1, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
znol \- notify via Zephyr upon login or logout of interesting people
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B znol
|
||||||
|
[
|
||||||
|
.BI on|off
|
||||||
|
] [
|
||||||
|
.BI \-f \ file
|
||||||
|
] [
|
||||||
|
.BI \-u \ username
|
||||||
|
] [
|
||||||
|
.BI \-l
|
||||||
|
] [
|
||||||
|
.BI \-q
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Znol
|
||||||
|
provides a way for you to be notified when "interesting" people log in
|
||||||
|
or out. It uses the
|
||||||
|
.I Zephyr(1)
|
||||||
|
Notification Service, which causes a message to appear on your screen
|
||||||
|
for every person specified in a namelist (which defaults to
|
||||||
|
$HOME/.anyone). The namelist should have one login name per line. Any
|
||||||
|
line starting with `#' is considered a comment and ignored.
|
||||||
|
Anyone in the namelist who is logged in when
|
||||||
|
.I znol
|
||||||
|
is executed is printed to stdout. The control arguments are as
|
||||||
|
follows:
|
||||||
|
.TP 12
|
||||||
|
.B on|off
|
||||||
|
Turns notification on or off.
|
||||||
|
.TP
|
||||||
|
.B \-f
|
||||||
|
The namelist file is taken to be
|
||||||
|
.I file.
|
||||||
|
If
|
||||||
|
.I file
|
||||||
|
is "-", then the standard input is used instead of a file. If
|
||||||
|
.I file
|
||||||
|
does not exist, an error message is printed, and
|
||||||
|
.I znol
|
||||||
|
exits.
|
||||||
|
This option may not be used in conjunction with the
|
||||||
|
.B \-u
|
||||||
|
option.
|
||||||
|
.TP
|
||||||
|
.B \-l
|
||||||
|
Causes
|
||||||
|
.I znol
|
||||||
|
to just list the people in the namelist who are currently logged in,
|
||||||
|
without subscribing to the login messages. This option may not be used
|
||||||
|
in conjunction with the
|
||||||
|
.BI \-q
|
||||||
|
option.
|
||||||
|
.TP
|
||||||
|
.B \-q
|
||||||
|
Disables printing who is currently logged in when subscribing. This
|
||||||
|
option may not be used in conjunction with the
|
||||||
|
.BI \-l
|
||||||
|
option.
|
||||||
|
.TP
|
||||||
|
.B \-u
|
||||||
|
Instead of reading a file to specify the "interesting" users, the next
|
||||||
|
argument is used as the only "interesting" user. This option may not be
|
||||||
|
used in conjunction with the
|
||||||
|
.B \-f
|
||||||
|
option.
|
||||||
|
.SH EXAMPLES
|
||||||
|
.nf
|
||||||
|
.in +.5in
|
||||||
|
znol
|
||||||
|
.in -.5in
|
||||||
|
.fi
|
||||||
|
reads the standard namelist file, prints the locations of any users
|
||||||
|
named therein which can be found on the system, and enters subscriptions
|
||||||
|
for notices about those users.
|
||||||
|
.nf
|
||||||
|
.in +.5in
|
||||||
|
znol \-l \-u foo
|
||||||
|
.in -.5in
|
||||||
|
.fi
|
||||||
|
prints the location (if visible) of the user 'foo'.
|
||||||
|
.SH FILES
|
||||||
|
$HOME/.anyone
|
||||||
|
.SH SEE ALSO
|
||||||
|
anyone(SIPB), nol(SIPB), zctl(1), zephyr(1), zwgc(1), zhm(8), zephyrd(8)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
Robert S. French (MIT-Project Athena)
|
||||||
|
.sp
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
256
clients/znol/znol.c
Normal file
256
clients/znol/znol.c
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for the "znol" command.
|
||||||
|
*
|
||||||
|
* Created by: Robert French
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid_znol_c[] = "$Id$";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SUBSATONCE 7
|
||||||
|
#define ON 1
|
||||||
|
#define OFF 0
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
register char *cp;
|
||||||
|
char *realm;
|
||||||
|
ZSubscription_t subs[SUBSATONCE];
|
||||||
|
ZLocations_t locations;
|
||||||
|
FILE *fp = NULL;
|
||||||
|
struct passwd *pwd;
|
||||||
|
char anyonename[BUFSIZ],name[BUFSIZ],cleanname[BUFSIZ],*envptr;
|
||||||
|
char *comment_ptr;
|
||||||
|
int onoff = ON,quiet = 0,justlist = 0,useronly = 0, filenamed = 0;
|
||||||
|
int retval,arg,ind,one,numlocs,i;
|
||||||
|
int wgport = 0;
|
||||||
|
|
||||||
|
if ((retval = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"initializing");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (arg=1;arg<argc;arg++) {
|
||||||
|
if (!strcmp(argv[arg],"on")) {
|
||||||
|
onoff = ON;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(argv[arg],"off")) {
|
||||||
|
onoff = OFF;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (argv[arg][0] == '-') {
|
||||||
|
char opt = argv[arg][1];
|
||||||
|
if (opt == 0 || argv[arg][2] != 0)
|
||||||
|
goto usage;
|
||||||
|
switch (argv[arg][1]) {
|
||||||
|
case 'q':
|
||||||
|
quiet = 1;
|
||||||
|
break;
|
||||||
|
case 'l':
|
||||||
|
justlist = 1;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
if (arg == argc-1) {
|
||||||
|
fprintf(stderr,"No file name specified\n");
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
(void) strcpy(anyonename,argv[++arg]);
|
||||||
|
filenamed = 1;
|
||||||
|
break;
|
||||||
|
case 'u':
|
||||||
|
if (arg == argc-1) {
|
||||||
|
fprintf(stderr,"No username specified\n");
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
(void) strcpy(cleanname,argv[++arg]);
|
||||||
|
useronly = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
usage:
|
||||||
|
fprintf(stderr,"Usage: %s [on|off] [-q | -l] [-f file | -u username]\n", argv[0]);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quiet && justlist) {
|
||||||
|
fprintf(stderr,"-q and -l cannot both be used\n");
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
if (useronly && filenamed) {
|
||||||
|
fprintf(stderr,"-u and -f cannot both be used\n");
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
if (!justlist)
|
||||||
|
if ((wgport = ZGetWGPort()) == -1) {
|
||||||
|
com_err(argv[0],errno,"while getting WindowGram port");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useronly) {
|
||||||
|
/* If no filename specified, get the default */
|
||||||
|
if (!filenamed) {
|
||||||
|
envptr = getenv("HOME");
|
||||||
|
if (envptr)
|
||||||
|
(void) strcpy(anyonename,envptr);
|
||||||
|
else {
|
||||||
|
if (!(pwd = getpwuid((int) getuid()))) {
|
||||||
|
fprintf(stderr,"You are not listed in the password file.\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
(void) strcpy(anyonename,pwd->pw_dir);
|
||||||
|
}
|
||||||
|
(void) strcat(anyonename,"/.anyone");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if the filename is "-", read stdin */
|
||||||
|
if (strcmp(anyonename,"-") == 0) {
|
||||||
|
fp = stdin;
|
||||||
|
} else if (!(fp = fopen(anyonename,"r"))) {
|
||||||
|
fprintf(stderr,"Can't open %s for input\n",anyonename);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ind = 0;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (!useronly) {
|
||||||
|
if (!fgets(cleanname,sizeof cleanname,fp))
|
||||||
|
break;
|
||||||
|
if (cleanname[0] == '#' || cleanname[0] == '\0' ||
|
||||||
|
cleanname[0] == '\n')
|
||||||
|
continue; /* ignore comment and empty lines */
|
||||||
|
comment_ptr = strchr(cleanname, '#');
|
||||||
|
if (comment_ptr)
|
||||||
|
*comment_ptr = '\0'; /* Ignore from # onwards */
|
||||||
|
/* Get rid of old-style nol entries, just in case */
|
||||||
|
cp = cleanname + strlen(cleanname) - 1;
|
||||||
|
*cp = '\0';
|
||||||
|
while(*--cp == ' ')
|
||||||
|
*cp = '\0';
|
||||||
|
if (*cleanname == '@' || !*cleanname)
|
||||||
|
continue;
|
||||||
|
} else if (ind)
|
||||||
|
break; /* only do the one name */
|
||||||
|
|
||||||
|
subs[ind].zsub_class = LOGIN_CLASS;
|
||||||
|
(void) strcpy(name,cleanname);
|
||||||
|
if (!strchr(name,'@')) {
|
||||||
|
cp = name + strlen(name);
|
||||||
|
*cp++ = '@';
|
||||||
|
(void) strcpy(cp,ZGetRealm());
|
||||||
|
}
|
||||||
|
cp = strchr(name,'@');
|
||||||
|
if (cp[0] && strcmp(cp+1,ZGetRealm())) {
|
||||||
|
realm = cp + 1;
|
||||||
|
*cp = '\0';
|
||||||
|
if ((subs[ind].zsub_classinst =
|
||||||
|
malloc((unsigned)(strlen(name) + strlen(realm) + 2)))
|
||||||
|
== NULL)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "znol: out of memory");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
(void) sprintf(subs[ind].zsub_classinst, "%s@%s", name,
|
||||||
|
realm);
|
||||||
|
(void) strcpy(name, subs[ind].zsub_classinst);
|
||||||
|
if ((subs[ind].zsub_recipient =
|
||||||
|
malloc((unsigned)(strlen(realm)+2))) == NULL) {
|
||||||
|
fprintf (stderr, "znol: out of memory");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
(void) sprintf(subs[ind++].zsub_recipient, "@%s", realm);
|
||||||
|
} else {
|
||||||
|
if ((subs[ind].zsub_classinst =
|
||||||
|
malloc((unsigned)(strlen(name)+1))) == NULL)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "znol: out of memory");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
(void) strcpy(subs[ind].zsub_classinst, name);
|
||||||
|
subs[ind++].zsub_recipient = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!quiet && onoff == ON) {
|
||||||
|
if ((retval = ZLocateUser(name,&numlocs,ZAUTH))
|
||||||
|
!= ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,"locating user");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
one = 1;
|
||||||
|
if (numlocs) {
|
||||||
|
for (i=0;i<numlocs;i++) {
|
||||||
|
if ((retval =
|
||||||
|
ZGetLocations(&locations,&one))
|
||||||
|
!= ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,
|
||||||
|
"getting location");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (one != 1) {
|
||||||
|
printf("%s: internal failure while getting location\n",argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
printf("%s: %s\t%s\t%s\n",cleanname,
|
||||||
|
locations.host,
|
||||||
|
locations.tty,
|
||||||
|
locations.time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ind == SUBSATONCE) {
|
||||||
|
if (!justlist)
|
||||||
|
if ((retval = (onoff==ON)?
|
||||||
|
ZSubscribeToSansDefaults(subs,ind,
|
||||||
|
(u_short)wgport):
|
||||||
|
ZUnsubscribeTo(subs,ind,(u_short)wgport)) !=
|
||||||
|
ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,(onoff==ON)?
|
||||||
|
"subscribing":
|
||||||
|
"unsubscribing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
for (ind=0;ind<SUBSATONCE;ind++)
|
||||||
|
{
|
||||||
|
if (subs[ind].zsub_recipient[0] != '\0')
|
||||||
|
free(subs[ind].zsub_recipient);
|
||||||
|
free(subs[ind].zsub_classinst);
|
||||||
|
}
|
||||||
|
ind = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ind && !justlist)
|
||||||
|
if ((retval = (onoff==ON)?
|
||||||
|
ZSubscribeToSansDefaults(subs,ind,(u_short)wgport):
|
||||||
|
ZUnsubscribeTo(subs,ind,(u_short)wgport)) !=
|
||||||
|
ZERR_NONE) {
|
||||||
|
com_err(argv[0],retval,(onoff==ON)?
|
||||||
|
"subscribing":
|
||||||
|
"unsubscribing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useronly)
|
||||||
|
(void) fclose(fp); /* file is open read-only,
|
||||||
|
ignore errs */
|
||||||
|
exit(0);
|
||||||
|
}
|
57
clients/zshutdown_notify/Makefile.in
Normal file
57
clients/zshutdown_notify/Makefile.in
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zshutdown_notify.o
|
||||||
|
|
||||||
|
all: zshutdown_notify
|
||||||
|
|
||||||
|
zshutdown_notify: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zshutdown_notify
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zshutdown_notify \
|
||||||
|
${DESTDIR}${lsbindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zshutdown_notify.8 ${DESTDIR}${mandir}/man8
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zshutdown_notify
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
43
clients/zshutdown_notify/zshutdown_notify.8
Normal file
43
clients/zshutdown_notify/zshutdown_notify.8
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.TH ZSHUTDOWN_NOTIFY 8 "July 8, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zshutdown_notify \- notify users of impending shutdown via Zephyr
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zshutdown_notify
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I zshutdown_notify
|
||||||
|
reads the standard input until EOF is reached, and then sends a Zephyr
|
||||||
|
notice with the official hostname, the collected input, and a warning
|
||||||
|
message as the message body of the notice.
|
||||||
|
The notice is sent to class FILSRV, instance
|
||||||
|
.I <hostname>,
|
||||||
|
recipient "*", where <hostname> is the official hostname of the sending host.
|
||||||
|
.PP
|
||||||
|
Any users who are using resources on the sending host are expected to
|
||||||
|
subscribe to these messages so they will be warned of any impending
|
||||||
|
shutdowns.
|
||||||
|
.PP
|
||||||
|
.I zshutdown_notify
|
||||||
|
is usually invoked from within
|
||||||
|
.I /etc/shutdown.
|
||||||
|
.SH SEE ALSO
|
||||||
|
attach(1), zephyr(1), zwgc(1), shutdown(8), zhm(8), zephyrd(8)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
C. Anthony Della Fera (Digital Equipment Corporation-Project Athena)
|
||||||
|
.sp
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
143
clients/zshutdown_notify/zshutdown_notify.c
Normal file
143
clients/zshutdown_notify/zshutdown_notify.c
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for "zshutdown_notify", a utility called by
|
||||||
|
* shutdown(8) to do Zephyr notification on shutdown.
|
||||||
|
*
|
||||||
|
* Created by: C. Anthony Della Fera
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987, 1993 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/mit-copyright.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <arpa/nameser.h>
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid_zshutdown_notify_c[] =
|
||||||
|
"$Id$";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define N_KIND UNSAFE
|
||||||
|
#define N_CLASS "FILSRV"
|
||||||
|
#define N_OPCODE "SHUTDOWN"
|
||||||
|
#define N_DEF_FORMAT "From $sender:\n@bold(Shutdown message from $1 at $time)\n@center(System going down, message is:)\n\n$2\n\n@center(@bold($3))"
|
||||||
|
#define N_FIELD_CNT 3
|
||||||
|
|
||||||
|
#ifdef HAVE_KRB4
|
||||||
|
#define SVC_NAME "rcmd"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Standard warning strings appended as extra fields to
|
||||||
|
* the message body.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static char warning[] = "Please detach any filesystems you may have\nattached from this host by typing detach -host %s";
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
|
int
|
||||||
|
main(int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
ZNotice_t notice;
|
||||||
|
struct hostent *hp;
|
||||||
|
int retval;
|
||||||
|
char hostname[NS_MAXDNAME];
|
||||||
|
char msgbuff[BUFSIZ], message[Z_MAXPKTLEN], *ptr;
|
||||||
|
char scratch[BUFSIZ];
|
||||||
|
char *msg[N_FIELD_CNT];
|
||||||
|
#ifdef HAVE_KRB4
|
||||||
|
char tkt_filename[MAXPATHLEN];
|
||||||
|
char rlm[REALM_SZ];
|
||||||
|
char hn2[NS_MAXDNAME];
|
||||||
|
char *cp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (gethostname(hostname, sizeof(hostname)) < 0) {
|
||||||
|
com_err(argv[0], errno, "while finding hostname");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((hp = gethostbyname(hostname)) != NULL)
|
||||||
|
(void) strcpy(hostname, hp->h_name);
|
||||||
|
|
||||||
|
msg[0] = hostname;
|
||||||
|
msg[1] = message;
|
||||||
|
sprintf(scratch, warning, hostname);
|
||||||
|
msg[2] = scratch;
|
||||||
|
|
||||||
|
#ifdef HAVE_KRB4
|
||||||
|
(void) sprintf(tkt_filename, "/tmp/tkt_zshut_%d", getpid());
|
||||||
|
krb_set_tkt_string(tkt_filename);
|
||||||
|
|
||||||
|
cp = krb_get_phost(hostname);
|
||||||
|
if (cp)
|
||||||
|
(void) strcpy(hn2, cp);
|
||||||
|
else {
|
||||||
|
fprintf(stderr, "%s: can't figure out canonical hostname\n",argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
retval = krb_get_lrealm(rlm, 1);
|
||||||
|
if (retval) {
|
||||||
|
fprintf(stderr, "%s: can't get local realm: %s\n",
|
||||||
|
argv[0], krb_get_err_text(retval));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
retval = krb_get_svc_in_tkt(SVC_NAME, hn2, rlm,
|
||||||
|
SERVER_SERVICE, SERVER_INSTANCE, 1,
|
||||||
|
(char *)KEYFILE);
|
||||||
|
if (retval) {
|
||||||
|
fprintf(stderr, "%s: can't get tickets: %s\n",
|
||||||
|
argv[0], krb_get_err_text(retval));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((retval = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err(argv[0], retval, "while initializing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = message;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (!fgets(msgbuff, sizeof(msgbuff), stdin))
|
||||||
|
break;
|
||||||
|
if ((strlen(msgbuff) + (ptr - message)) > Z_MAXPKTLEN){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
(void) strcpy(ptr, msgbuff);
|
||||||
|
ptr += strlen(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) memset((char *)¬ice, 0, sizeof(notice));
|
||||||
|
|
||||||
|
notice.z_kind = N_KIND;
|
||||||
|
notice.z_port = 0;
|
||||||
|
notice.z_charset = ZCHARSET_UNKNOWN;
|
||||||
|
notice.z_class = N_CLASS;
|
||||||
|
notice.z_class_inst = hostname;
|
||||||
|
notice.z_opcode = N_OPCODE;
|
||||||
|
notice.z_sender = 0;
|
||||||
|
notice.z_message_len = 0;
|
||||||
|
notice.z_recipient = "";
|
||||||
|
notice.z_default_format = N_DEF_FORMAT;
|
||||||
|
|
||||||
|
retval = ZSendList(¬ice, msg, N_FIELD_CNT, ZAUTH);
|
||||||
|
#ifdef HAVE_KRB4
|
||||||
|
(void) dest_tkt();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (retval != ZERR_NONE) {
|
||||||
|
com_err(argv[0], retval, "while sending notice");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
56
clients/zstat/Makefile.in
Normal file
56
clients/zstat/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zstat.o
|
||||||
|
|
||||||
|
all: zstat
|
||||||
|
|
||||||
|
zstat: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zstat
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zstat ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zstat.8 ${DESTDIR}${mandir}/man8
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zstat
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: zserver.h ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
26
clients/zstat/zserver.h
Normal file
26
clients/zstat/zserver.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef __ZSERVER_H__
|
||||||
|
#define __ZSERVER_H__
|
||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains declarations for use in the server.
|
||||||
|
*
|
||||||
|
* Created by: John T. Kohl
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ADMIN_HELLO "HELLO" /* Opcode: hello, are you there */
|
||||||
|
#define ADMIN_IMHERE "IHEARDYOU" /* Opcode: yes, I am here */
|
||||||
|
#define ADMIN_SHUTDOWN "GOODBYE" /* Opcode: I am shutting down */
|
||||||
|
#define ADMIN_BDUMP "DUMP_AVAIL" /* Opcode: I will give you a dump */
|
||||||
|
#define ADMIN_DONE "DUMP_DONE" /* Opcode: brain dump for this server
|
||||||
|
is complete */
|
||||||
|
#define ADMIN_NEWCLT "NEXT_CLIENT" /* Opcode: this is a new client */
|
||||||
|
#define ADMIN_LOST_CLT "LOST_CLIENT" /* Opcode: client not ack'ing */
|
||||||
|
#define ADMIN_KILL_CLT "KILL_CLIENT" /* Opcode: client is dead, remove */
|
||||||
|
#define ADMIN_STATUS "STATUS" /* Opcode: please send status */
|
||||||
|
|
||||||
|
#endif /* !__ZSERVER_H__ */
|
51
clients/zstat/zstat.8
Normal file
51
clients/zstat/zstat.8
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\"
|
||||||
|
.TH ZSTAT 8 "July 1, 1988" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zstat \- display Zephyr statistics
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zstat
|
||||||
|
[
|
||||||
|
.BI -h
|
||||||
|
] [
|
||||||
|
.BI -s
|
||||||
|
] [
|
||||||
|
.BI host \ ...
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Zstat
|
||||||
|
is used to display statistics reported by a HostManager,
|
||||||
|
.I zhm(8),
|
||||||
|
or a Zephyr Server
|
||||||
|
.I zephyrd(8),
|
||||||
|
or both.
|
||||||
|
.TP 12
|
||||||
|
.B \-h
|
||||||
|
is used to indicate that only HostManager statistics should be displayed.
|
||||||
|
.TP
|
||||||
|
.B \-s
|
||||||
|
is used to indicate that only server statistics should be displayed.
|
||||||
|
.TP
|
||||||
|
If no hosts are specified, the current host is assumed.
|
||||||
|
When both HostManager and server statistics are displayed,
|
||||||
|
statistics from the current server for each host are displayed.
|
||||||
|
.SH SEE ALSO
|
||||||
|
zephyr(1), zhm(8), zephyrd(8)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
David C. Jedlinsky (MIT-Project Athena)
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
312
clients/zstat/zstat.c
Normal file
312
clients/zstat/zstat.c
Normal file
@ -0,0 +1,312 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains the zstat program.
|
||||||
|
*
|
||||||
|
* Created by: David C. Jedlinsky
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* There should be library interfaces for the operations in zstat; for now,
|
||||||
|
* however, zstat is more or less internal to the Zephyr system. */
|
||||||
|
#include <internal.h>
|
||||||
|
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <arpa/nameser.h>
|
||||||
|
#include "zserver.h"
|
||||||
|
|
||||||
|
#if !defined(lint) && !defined(SABER)
|
||||||
|
static const char rcsid_zstat_c[] = "$Id$";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const char *hm_head[] = {
|
||||||
|
"Current server =",
|
||||||
|
"Items in queue:",
|
||||||
|
"Client packets received:",
|
||||||
|
"Server packets received:",
|
||||||
|
"Server changes:",
|
||||||
|
"Version:",
|
||||||
|
"Looking for a new server:",
|
||||||
|
"Time running:",
|
||||||
|
"Size:",
|
||||||
|
"Machine type:"
|
||||||
|
};
|
||||||
|
#define HM_SIZE (sizeof(hm_head) / sizeof (char *))
|
||||||
|
const char *srv_head[] = {
|
||||||
|
"Current server version =",
|
||||||
|
"Packets handled:",
|
||||||
|
"Uptime:",
|
||||||
|
"Server states:",
|
||||||
|
};
|
||||||
|
#define SRV_SIZE (sizeof(srv_head) / sizeof (char *))
|
||||||
|
|
||||||
|
int outoftime = 0;
|
||||||
|
|
||||||
|
int serveronly = 0,hmonly = 0;
|
||||||
|
u_short srv_port;
|
||||||
|
|
||||||
|
void usage(char *);
|
||||||
|
void do_stat(char *);
|
||||||
|
int srv_stat(char *);
|
||||||
|
int hm_stat(char *, char *);
|
||||||
|
|
||||||
|
static RETSIGTYPE
|
||||||
|
timeout(int ignored)
|
||||||
|
{
|
||||||
|
outoftime = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
Code_t ret;
|
||||||
|
char hostname[NS_MAXDNAME];
|
||||||
|
int optchar;
|
||||||
|
struct servent *sp;
|
||||||
|
|
||||||
|
if ((ret = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err("zstat", ret, "initializing");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ret = ZOpenPort((u_short *)0)) != ZERR_NONE) {
|
||||||
|
com_err("zstat", ret, "opening port");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((optchar = getopt(argc, argv, "sh")) != EOF) {
|
||||||
|
switch(optchar) {
|
||||||
|
case 's':
|
||||||
|
serveronly++;
|
||||||
|
break;
|
||||||
|
case 'h':
|
||||||
|
hmonly++;
|
||||||
|
break;
|
||||||
|
case '?':
|
||||||
|
default:
|
||||||
|
usage(argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (serveronly && hmonly) {
|
||||||
|
fprintf(stderr,"Only one of -s and -h may be specified\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
sp = getservbyname(SERVER_SVCNAME,"udp");
|
||||||
|
srv_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK;
|
||||||
|
|
||||||
|
if (optind == argc) {
|
||||||
|
do_stat("127.0.0.1");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;optind<argc;optind++)
|
||||||
|
do_stat(argv[optind]);
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
do_stat(char *host)
|
||||||
|
{
|
||||||
|
char srv_host[NS_MAXDNAME];
|
||||||
|
|
||||||
|
if (serveronly) {
|
||||||
|
(void) srv_stat(host);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hm_stat(host,srv_host))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!hmonly)
|
||||||
|
(void) srv_stat(srv_host);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
hm_stat(char *host,
|
||||||
|
char *server)
|
||||||
|
{
|
||||||
|
struct in_addr inaddr;
|
||||||
|
Code_t code;
|
||||||
|
|
||||||
|
char *line[20],*mp;
|
||||||
|
unsigned int i,nf;
|
||||||
|
struct hostent *hp;
|
||||||
|
time_t runtime;
|
||||||
|
struct tm *tim;
|
||||||
|
ZNotice_t notice;
|
||||||
|
|
||||||
|
if ((inaddr.s_addr = inet_addr(host)) == (unsigned)(-1)) {
|
||||||
|
if ((hp = gethostbyname(host)) == NULL) {
|
||||||
|
fprintf(stderr,"Unknown host: %s\n",host);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
(void) memcpy((char *) &inaddr, hp->h_addr, hp->h_length);
|
||||||
|
|
||||||
|
printf("Hostmanager stats: %s\n", hp->h_name);
|
||||||
|
} else {
|
||||||
|
printf("Hostmanager stats: %s\n", host);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((code = ZhmStat(&inaddr, ¬ice)) != ZERR_NONE) {
|
||||||
|
com_err("zstat", code, "getting hostmanager status");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
mp = notice.z_message;
|
||||||
|
for (nf=0;mp<notice.z_message+notice.z_message_len;nf++) {
|
||||||
|
line[nf] = mp;
|
||||||
|
mp += strlen(mp)+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) strcpy(server,line[0]);
|
||||||
|
|
||||||
|
printf("HostManager protocol version = %s\n",notice.z_version);
|
||||||
|
|
||||||
|
for (i=0; (i < nf) && (i < HM_SIZE); i++) {
|
||||||
|
if (!strncmp("Time",hm_head[i],4)) {
|
||||||
|
runtime = atol(line[i]);
|
||||||
|
tim = gmtime(&runtime);
|
||||||
|
printf("%s %d days, %02d:%02d:%02d\n", hm_head[i],
|
||||||
|
tim->tm_yday,
|
||||||
|
tim->tm_hour,
|
||||||
|
tim->tm_min,
|
||||||
|
tim->tm_sec);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("%s %s\n",hm_head[i],line[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
srv_stat(char *host)
|
||||||
|
{
|
||||||
|
char *line[20],*mp;
|
||||||
|
int sock,i,nf,ret;
|
||||||
|
struct hostent *hp;
|
||||||
|
struct sockaddr_in sin;
|
||||||
|
ZNotice_t notice;
|
||||||
|
time_t runtime;
|
||||||
|
struct tm *tim;
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
struct sigaction sa;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
(void) memset((char *) &sin, 0, sizeof(struct sockaddr_in));
|
||||||
|
|
||||||
|
sin.sin_port = srv_port;
|
||||||
|
|
||||||
|
if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||||
|
perror("socket:");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
sin.sin_family = AF_INET;
|
||||||
|
|
||||||
|
if ((sin.sin_addr.s_addr = inet_addr(host)) == (unsigned)(-1)) {
|
||||||
|
if ((hp = gethostbyname(host)) == NULL) {
|
||||||
|
fprintf(stderr,"Unknown host: %s\n",host);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
(void) memcpy((char *) &sin.sin_addr, hp->h_addr, hp->h_length);
|
||||||
|
|
||||||
|
printf("Server stats: %s\n", hp->h_name);
|
||||||
|
} else {
|
||||||
|
printf("Server stats: %s\n", host);
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) memset((char *)¬ice, 0, sizeof(notice));
|
||||||
|
notice.z_kind = UNSAFE;
|
||||||
|
notice.z_port = 0;
|
||||||
|
notice.z_charset = ZCHARSET_UNKNOWN;
|
||||||
|
notice.z_class = ZEPHYR_ADMIN_CLASS;
|
||||||
|
notice.z_class_inst = "";
|
||||||
|
notice.z_opcode = ADMIN_STATUS;
|
||||||
|
notice.z_sender = "";
|
||||||
|
notice.z_recipient = "";
|
||||||
|
notice.z_default_format = "";
|
||||||
|
notice.z_message_len = 0;
|
||||||
|
|
||||||
|
if ((ret = ZSetDestAddr(&sin)) != ZERR_NONE) {
|
||||||
|
com_err("zstat", ret, "setting destination");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
if ((ret = ZSendNotice(¬ice, ZNOAUTH)) != ZERR_NONE) {
|
||||||
|
com_err("zstat", ret, "sending notice");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sa.sa_handler = timeout;
|
||||||
|
(void) sigaction(SIGALRM, &sa, (struct sigaction *)0);
|
||||||
|
#else
|
||||||
|
(void) signal(SIGALRM,timeout);
|
||||||
|
#endif
|
||||||
|
outoftime = 0;
|
||||||
|
(void) alarm(10);
|
||||||
|
if (((ret = ZReceiveNotice(¬ice, (struct sockaddr_in *) 0))
|
||||||
|
!= ZERR_NONE) &&
|
||||||
|
ret != EINTR) {
|
||||||
|
com_err("zstat", ret, "receiving notice");
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
(void) alarm(0);
|
||||||
|
if (outoftime) {
|
||||||
|
fprintf(stderr,"No response after 10 seconds.\n");
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
mp = notice.z_message;
|
||||||
|
for (nf=0;mp<notice.z_message+notice.z_message_len;nf++) {
|
||||||
|
line[nf] = mp;
|
||||||
|
mp += strlen(mp)+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Server protocol version = %s\n",notice.z_version);
|
||||||
|
|
||||||
|
for (i=0; i < nf; i++) {
|
||||||
|
if (i < 2)
|
||||||
|
printf("%s %s\n",srv_head[i],line[i]);
|
||||||
|
else if (i == 2) { /* uptime field */
|
||||||
|
runtime = atol(line[i]);
|
||||||
|
tim = gmtime(&runtime);
|
||||||
|
printf("%s %d days, %02d:%02d:%02d\n",
|
||||||
|
srv_head[i],
|
||||||
|
tim->tm_yday,
|
||||||
|
tim->tm_hour,
|
||||||
|
tim->tm_min,
|
||||||
|
tim->tm_sec);
|
||||||
|
} else if (i == 3) {
|
||||||
|
printf("%s\n",srv_head[i]);
|
||||||
|
printf("%s\n",line[i]);
|
||||||
|
} else printf("%s\n",line[i]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
(void) close(sock);
|
||||||
|
ZFreeNotice(¬ice);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
usage(char *s)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"usage: %s [-s] [-h] [host ...]\n",s);
|
||||||
|
exit(1);
|
||||||
|
}
|
56
clients/zwrite/Makefile.in
Normal file
56
clients/zwrite/Makefile.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SHELL=@SHELL@
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
datadir=@datadir@
|
||||||
|
sysconfdir=@sysconfdir@
|
||||||
|
sbindir=@sbindir@
|
||||||
|
lsbindir=@lsbindir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
|
||||||
|
includedir=@includedir@
|
||||||
|
mandir=@mandir@
|
||||||
|
libdir=@libdir@
|
||||||
|
bindir=@bindir@
|
||||||
|
top_builddir=../..
|
||||||
|
|
||||||
|
srcdir=@srcdir@
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
BUILDTOP=../..
|
||||||
|
VPATH=@srcdir@
|
||||||
|
LIBTOOL=@LIBTOOL@
|
||||||
|
CC=@CC@
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
|
||||||
|
LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
|
||||||
|
CPPFLAGS=@CPPFLAGS@
|
||||||
|
CFLAGS=@CFLAGS@
|
||||||
|
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
|
||||||
|
LDFLAGS=@LDFLAGS@
|
||||||
|
LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
|
||||||
|
|
||||||
|
OBJS= zwrite.o
|
||||||
|
|
||||||
|
all: zwrite
|
||||||
|
|
||||||
|
zwrite: ${OBJS} ${LIBZEPHYR}
|
||||||
|
${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${ALL_CFLAGS} $<
|
||||||
|
|
||||||
|
check:
|
||||||
|
|
||||||
|
install: zwrite
|
||||||
|
${LIBTOOL} --mode=install ${INSTALL} -m 755 zwrite ${DESTDIR}${bindir}
|
||||||
|
${INSTALL} -m 644 ${srcdir}/zwrite.1 ${DESTDIR}${mandir}/man1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${LIBTOOL} --mode=clean rm -f zwrite
|
||||||
|
rm -f ${OBJS}
|
||||||
|
|
||||||
|
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
|
||||||
|
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
|
||||||
|
|
||||||
|
.PHONY: all check install clean
|
||||||
|
|
290
clients/zwrite/zwrite.1
Normal file
290
clients/zwrite/zwrite.1
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1987,1988 by the Massachusetts Institute of Technology
|
||||||
|
.\" All rights reserved. The file /usr/include/zephyr/mit-copyright.h
|
||||||
|
.\" specifies the terms and conditions for redistribution.
|
||||||
|
.\"
|
||||||
|
.\"
|
||||||
|
.TH ZWRITE 1 "October 26, 1989" "MIT Project Athena"
|
||||||
|
.ds ]W MIT Project Athena
|
||||||
|
.SH NAME
|
||||||
|
zwrite \- write to another user via Zephyr
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zwrite
|
||||||
|
[
|
||||||
|
.BI \-a
|
||||||
|
] [
|
||||||
|
.BI \-d
|
||||||
|
] [
|
||||||
|
.BI \-v
|
||||||
|
] [
|
||||||
|
.BI \-q
|
||||||
|
] [
|
||||||
|
.BI \-t
|
||||||
|
] [
|
||||||
|
.BI \-u
|
||||||
|
] [
|
||||||
|
.BI \-o
|
||||||
|
] [
|
||||||
|
.BI \-n
|
||||||
|
] [
|
||||||
|
.BI \-l
|
||||||
|
] [
|
||||||
|
.BI \-C
|
||||||
|
] [
|
||||||
|
.BI \-U
|
||||||
|
] [
|
||||||
|
.BI \-O
|
||||||
|
opcode ] [
|
||||||
|
.BI \-s
|
||||||
|
signature ] [
|
||||||
|
.BI \-c
|
||||||
|
class ] [
|
||||||
|
.BI \-i
|
||||||
|
instance ] [
|
||||||
|
.BI \-r
|
||||||
|
realm ] [
|
||||||
|
.BI \-f
|
||||||
|
arg ] [
|
||||||
|
.BI \-S
|
||||||
|
sender ] [
|
||||||
|
.BI user \ ...
|
||||||
|
] [
|
||||||
|
.BI \-m
|
||||||
|
.BI message
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I Zwrite
|
||||||
|
sends a message from you to another user through the
|
||||||
|
.I zephyr(1)
|
||||||
|
notification service. The user must have subscribed to messages of
|
||||||
|
the appropriate class and instance using the
|
||||||
|
.I zctl(1)
|
||||||
|
program.
|
||||||
|
.PP
|
||||||
|
.I Zwrite
|
||||||
|
understands the following options.
|
||||||
|
.TP 12
|
||||||
|
.B \-a
|
||||||
|
Causes
|
||||||
|
.I zwrite
|
||||||
|
to send the message authenticated, using
|
||||||
|
.I Kerberos
|
||||||
|
to perform the authentication. This is the default.
|
||||||
|
.TP
|
||||||
|
.B \-d
|
||||||
|
Causes
|
||||||
|
.I zwrite
|
||||||
|
to send the message unauthenticated.
|
||||||
|
.TP
|
||||||
|
.B \-v
|
||||||
|
Causes
|
||||||
|
.I zwrite
|
||||||
|
to print what type of message it is sending, and whether or not it was
|
||||||
|
successful.
|
||||||
|
.TP
|
||||||
|
.B \-q
|
||||||
|
Forces
|
||||||
|
.I zwrite
|
||||||
|
to suppress information about whether or not the message was sent.
|
||||||
|
.TP
|
||||||
|
.B \-t
|
||||||
|
Prevents
|
||||||
|
.I zwrite
|
||||||
|
from expanding tabs in the message into appropriate spaces. Normally
|
||||||
|
.I zwrite
|
||||||
|
will expand any tabs it finds into the appropriate number of spaces to
|
||||||
|
maintain separation based on 8-character tab stops.
|
||||||
|
.TP
|
||||||
|
.B \-l
|
||||||
|
Causes
|
||||||
|
.I zwrite
|
||||||
|
to ignore `.' on a line by itself in the input and only end a typed
|
||||||
|
message when the user types the end-of-file character (usually
|
||||||
|
control-D). When the input is not a terminal, this is the default action.
|
||||||
|
.TP
|
||||||
|
.B \-u
|
||||||
|
Sends an urgent message. This changes the
|
||||||
|
.I zephyr
|
||||||
|
instance of the message to ``URGENT''.
|
||||||
|
.TP
|
||||||
|
.B \-o
|
||||||
|
Causes
|
||||||
|
.I zwrite
|
||||||
|
to ignore the Zephyr variables
|
||||||
|
.IR zwrite-class ,
|
||||||
|
.IR zwrite-inst ,
|
||||||
|
and
|
||||||
|
.I zwrite-opcode
|
||||||
|
when picking a default class, instance, and opcode.
|
||||||
|
.TP
|
||||||
|
.B \-n
|
||||||
|
prevents
|
||||||
|
.I zwrite
|
||||||
|
from sending a PING message to verify the recipient is subscribing to
|
||||||
|
messages. By default,
|
||||||
|
.I zwrite
|
||||||
|
will send a notice to the destination class, instance, and recipient,
|
||||||
|
with opcode ``PING'' before sending the message. If the PING is sent,
|
||||||
|
and the server response indicates there are no recipients subscribed to
|
||||||
|
your message,
|
||||||
|
.I zwrite
|
||||||
|
exits without sending a message.
|
||||||
|
When the
|
||||||
|
.B \-n
|
||||||
|
option is used, no PING is sent.
|
||||||
|
.TP
|
||||||
|
.B \-C
|
||||||
|
prepends a "CC:" line to the body of the message indicating the
|
||||||
|
recipients of the message. This is strictly a convenience: the
|
||||||
|
presence of a "CC:" line at the top of a zephyr body does not
|
||||||
|
necessarily indicate that this option was used, or that the message
|
||||||
|
really was sent to the listed users, and its lack doesn't indicate
|
||||||
|
that the message was not sent to multiple users.
|
||||||
|
.TP
|
||||||
|
.B \-U
|
||||||
|
Send an unacked message.
|
||||||
|
.I zwrite
|
||||||
|
will not wait for acknowledgement that the message was sent, nor will
|
||||||
|
it issue a PING before sending.
|
||||||
|
.TP
|
||||||
|
.B \-s \fIsignature\fR
|
||||||
|
sets the signature to be included in the message. This overrides both
|
||||||
|
the user's name (as found in the password file) and any
|
||||||
|
setting of the Zephyr variable
|
||||||
|
.IR zwrite-signature .
|
||||||
|
.I signature
|
||||||
|
must
|
||||||
|
be a single argument, hence when using a shell it should be quoted with
|
||||||
|
double quotes. A
|
||||||
|
.I signature
|
||||||
|
argument of "" leaves the signature in
|
||||||
|
the message empty.
|
||||||
|
.TP
|
||||||
|
.B \-c \fIclass\fR
|
||||||
|
Allows a user to specify a different class for the message. This allows
|
||||||
|
a message to be sent to a large group of people with some degree of
|
||||||
|
security. See
|
||||||
|
.I zephyr(1)
|
||||||
|
and
|
||||||
|
.I zephyrd(8)
|
||||||
|
for a description of how to restrict access to classes. When this option
|
||||||
|
is specified, the message is sent to recipient "*" unless an additional
|
||||||
|
list of recipients is specified.
|
||||||
|
.br
|
||||||
|
This argument may not be used in conjunction with the \-f option.
|
||||||
|
.TP
|
||||||
|
.B \-i \fIinstance\fR
|
||||||
|
Allows a user to specify a different instance than the default.
|
||||||
|
When this option is used, the message is sent to recipient "*" unless an
|
||||||
|
additional list of recipients is specified. This allows a message to be
|
||||||
|
sent to a large group of people (e.g. a development group) just by having
|
||||||
|
the members subscribe to messages of class "MESSAGE", the specified instance,
|
||||||
|
and recipient "*".
|
||||||
|
.br
|
||||||
|
This argument may not be used in conjunction with the \-f option.
|
||||||
|
.TP
|
||||||
|
.B \-r \fIrealm\fR
|
||||||
|
Allows a user to specify a different realm for the message, if the
|
||||||
|
server supports interrealm Zephyr.
|
||||||
|
.TP
|
||||||
|
.B \-S \fIsender\fR
|
||||||
|
Specify a sender. The message will be sent unauthenticated.
|
||||||
|
.TP
|
||||||
|
.B \-F \fIformat\fR
|
||||||
|
Allows a user to specify a different default format for the message.
|
||||||
|
.TP
|
||||||
|
.B \-O \fIopcode\fR
|
||||||
|
Allows a user to specify a different opcode for the message.
|
||||||
|
Some Zephyr notice display programs may use the opcode to decide how
|
||||||
|
to display a notice.
|
||||||
|
.TP
|
||||||
|
.B \-f \fIarg\fR
|
||||||
|
Allows a user to specify an argument to be interpreted as a filesystem
|
||||||
|
specification. The class is set to
|
||||||
|
.BR FILSRV .
|
||||||
|
he instance is set
|
||||||
|
to
|
||||||
|
.I arg
|
||||||
|
as modified:
|
||||||
|
If
|
||||||
|
.I arg
|
||||||
|
contains no colons (`:'), it is assumed to
|
||||||
|
be a host name, and it is converted into an official host name via
|
||||||
|
.I gethostbyname(3).
|
||||||
|
If
|
||||||
|
.I arg
|
||||||
|
contains a colon, the portion preceding the colon is
|
||||||
|
treated as a host name, and the colon and any trailing characters are
|
||||||
|
appended to the offical host name returned by
|
||||||
|
.I gethostbyname.
|
||||||
|
If the name fails to resolve into an official host name, the instance is
|
||||||
|
set to
|
||||||
|
.I arg
|
||||||
|
unmodified.
|
||||||
|
.br
|
||||||
|
This option may not be used in conjunction with the \-c or \-i option.
|
||||||
|
.TP
|
||||||
|
.B \-m
|
||||||
|
.I Zwrite
|
||||||
|
sends the remaining arguments on the command line as the message.
|
||||||
|
.PP
|
||||||
|
If the
|
||||||
|
.I \-m
|
||||||
|
option is not specified, the user is prompted for the message to be
|
||||||
|
sent. The message may be terminated by typing ^D or ``.'' on a line
|
||||||
|
by itself.
|
||||||
|
.PP
|
||||||
|
The default class for messages is ``MESSAGE'', the default instance
|
||||||
|
is ``PERSONAL'', andthe default opcode is ``'' (an empty string).
|
||||||
|
These defaults can be overridden by setting the Zephyr
|
||||||
|
variables
|
||||||
|
.IR zwrite-class ,
|
||||||
|
.IR zwrite-inst ,
|
||||||
|
and
|
||||||
|
.IR zwrite-opcode ,
|
||||||
|
respectively.
|
||||||
|
Command-line options can override the defaults.
|
||||||
|
.PP
|
||||||
|
If the class is ``MESSAGE'' and the instance is either ``PERSONAL'' or
|
||||||
|
``URGENT'', a recipient must be specified. These comparisons are
|
||||||
|
case-sensitive.
|
||||||
|
.PP
|
||||||
|
Unless the
|
||||||
|
.B \-s
|
||||||
|
option is used, the contents of the Zephyr variable
|
||||||
|
.I zwrite-signature
|
||||||
|
are used to augment the user's username in the
|
||||||
|
message. If
|
||||||
|
.I zwrite-signature
|
||||||
|
is not set and the
|
||||||
|
.B \-s
|
||||||
|
option is not specified, the user's full name (as specified in the
|
||||||
|
password file) is used instead.
|
||||||
|
.SH BUGS
|
||||||
|
Tab expansion should really be done by the receiver of the message.
|
||||||
|
.br
|
||||||
|
The \-u option is provided for compatibility with old versions of
|
||||||
|
.I zwrite
|
||||||
|
and is not necessarily useful for sending messages to users who do not
|
||||||
|
have old subscription files.
|
||||||
|
.SH SEE ALSO
|
||||||
|
kerberosintro(1), zctl(1), zephyr(1), zwgc(1), zhm(8), zephyrd(8),
|
||||||
|
gethostbyname(3)
|
||||||
|
.br
|
||||||
|
Project Athena Technical Plan Section E.4.1, `Zephyr Notification
|
||||||
|
Service'
|
||||||
|
.SH FILES
|
||||||
|
/etc/passwd
|
||||||
|
.br
|
||||||
|
$ZEPHYR_VARS or $HOME/.zephyr.vars
|
||||||
|
.SH AUTHOR
|
||||||
|
.PP
|
||||||
|
.br
|
||||||
|
Robert S. French (MIT-Project Athena)
|
||||||
|
.SH RESTRICTIONS
|
||||||
|
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
All Rights Reserved.
|
||||||
|
.br
|
||||||
|
.I zephyr(1)
|
||||||
|
specifies the terms and conditions for redistribution.
|
568
clients/zwrite/zwrite.c
Normal file
568
clients/zwrite/zwrite.c
Normal file
@ -0,0 +1,568 @@
|
|||||||
|
/* This file is part of the Project Athena Zephyr Notification System.
|
||||||
|
* It contains code for the "zwrite" command.
|
||||||
|
*
|
||||||
|
* Created by: Robert French
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
|
||||||
|
* For copying and distribution information, see the file
|
||||||
|
* "mit-copyright.h".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <zephyr/mit-copyright.h>
|
||||||
|
#include <zephyr/zephyr.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid_zwrite_c[] = "$Id$";
|
||||||
|
#endif /* lint */
|
||||||
|
|
||||||
|
#define DEFAULT_CLASS "MESSAGE"
|
||||||
|
#define DEFAULT_INSTANCE "PERSONAL"
|
||||||
|
#define URGENT_INSTANCE "URGENT"
|
||||||
|
#define DEFAULT_OPCODE ""
|
||||||
|
#define FILSRV_CLASS "FILSRV"
|
||||||
|
|
||||||
|
#define MAXRECIPS 100
|
||||||
|
|
||||||
|
int nrecips, msgarg, verbose, quiet, nodot, cc;
|
||||||
|
char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS], *sender = 0;
|
||||||
|
Z_AuthProc auth;
|
||||||
|
ZNotice_Kind_t kind = ACKED;
|
||||||
|
void un_tabify(char **, int *);
|
||||||
|
|
||||||
|
char *fix_filsrv_inst(char *);
|
||||||
|
void usage(char *);
|
||||||
|
void send_off(ZNotice_t *, int);
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int retval, arg, nocheck, nchars, msgsize, filsys, tabexpand;
|
||||||
|
char *message, *signature = NULL, *format = NULL;
|
||||||
|
static char bfr[BUFSIZ], classbfr[BUFSIZ], instbfr[BUFSIZ], sigbfr[BUFSIZ];
|
||||||
|
static char opbfr[BUFSIZ];
|
||||||
|
static ZNotice_t notice;
|
||||||
|
char *charset = NULL;
|
||||||
|
|
||||||
|
whoami = argv[0];
|
||||||
|
|
||||||
|
if ((retval = ZInitialize()) != ZERR_NONE) {
|
||||||
|
com_err(whoami, retval, "while initializing");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
usage(whoami);
|
||||||
|
|
||||||
|
auth = ZAUTH;
|
||||||
|
verbose = quiet = msgarg = nrecips = nocheck = filsys = nodot = 0;
|
||||||
|
tabexpand = 1;
|
||||||
|
|
||||||
|
class = ZGetVariable("zwrite-class");
|
||||||
|
if (class) {
|
||||||
|
(void) strcpy(classbfr, class);
|
||||||
|
class = classbfr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
class = DEFAULT_CLASS;
|
||||||
|
inst = ZGetVariable("zwrite-inst");
|
||||||
|
if (inst) {
|
||||||
|
(void) strcpy(instbfr, inst);
|
||||||
|
inst = instbfr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
inst = DEFAULT_INSTANCE;
|
||||||
|
|
||||||
|
opcode = ZGetVariable("zwrite-opcode");
|
||||||
|
if (opcode)
|
||||||
|
opcode = strcpy(opbfr, opcode);
|
||||||
|
else
|
||||||
|
opcode = DEFAULT_OPCODE;
|
||||||
|
|
||||||
|
signature = ZGetVariable("zwrite-signature");
|
||||||
|
if (signature) {
|
||||||
|
(void) strcpy(sigbfr, signature);
|
||||||
|
signature = sigbfr;
|
||||||
|
}
|
||||||
|
|
||||||
|
arg = 1;
|
||||||
|
|
||||||
|
for (;arg<argc && !msgarg; arg++) {
|
||||||
|
if (*argv[arg] != '-') {
|
||||||
|
recips[nrecips++] = argv[arg];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (strlen(argv[arg]) > 2)
|
||||||
|
usage(whoami);
|
||||||
|
switch (argv[arg][1]) {
|
||||||
|
case 'a': /* Backwards compatibility */
|
||||||
|
auth = ZAUTH;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
class = DEFAULT_CLASS;
|
||||||
|
inst = DEFAULT_INSTANCE;
|
||||||
|
opcode = DEFAULT_OPCODE;
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
auth = ZNOAUTH;
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
verbose = 1;
|
||||||
|
break;
|
||||||
|
case 'q':
|
||||||
|
quiet = 1;
|
||||||
|
break;
|
||||||
|
case 'n':
|
||||||
|
nocheck = 1;
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
tabexpand = 0;
|
||||||
|
break;
|
||||||
|
case 'u':
|
||||||
|
inst = URGENT_INSTANCE;
|
||||||
|
break;
|
||||||
|
case 'O':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
opcode = argv[arg];
|
||||||
|
break;
|
||||||
|
case 'i':
|
||||||
|
if (arg == argc-1 || filsys == 1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
inst = argv[arg];
|
||||||
|
filsys = -1;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
if (arg == argc-1 || filsys == 1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
class = argv[arg];
|
||||||
|
filsys = -1;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
if (arg == argc-1 || filsys == -1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
class = FILSRV_CLASS;
|
||||||
|
inst = fix_filsrv_inst(argv[arg]);
|
||||||
|
filsys = 1;
|
||||||
|
nocheck = 1; /* implied -n (no ping) */
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
signature = argv[arg];
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
nocheck = 1; /* implied -n (no ping) */
|
||||||
|
msgarg = arg+1;
|
||||||
|
break;
|
||||||
|
case 'l': /* literal */
|
||||||
|
nodot = 1;
|
||||||
|
break;
|
||||||
|
case 'F':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
format = argv[arg];
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
realm = argv[arg];
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
cc = 1;
|
||||||
|
break;
|
||||||
|
case 'x':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
charset = argv[arg];
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
if (arg == argc-1)
|
||||||
|
usage(whoami);
|
||||||
|
arg++;
|
||||||
|
sender = argv[arg];
|
||||||
|
auth = ZNOAUTH;
|
||||||
|
break;
|
||||||
|
case 'U':
|
||||||
|
kind = UNACKED;
|
||||||
|
nocheck = 1; /* implied -n (no ping) */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
usage(whoami);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nrecips && !(strcmp(class, DEFAULT_CLASS) ||
|
||||||
|
(strcmp(inst, DEFAULT_INSTANCE) &&
|
||||||
|
strcmp(inst, URGENT_INSTANCE)))) {
|
||||||
|
/* must specify recipient if using default class and
|
||||||
|
(default instance or urgent instance) */
|
||||||
|
fprintf(stderr, "No recipients specified.\n");
|
||||||
|
usage(whoami);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!signature) {
|
||||||
|
/* try to find name in the password file */
|
||||||
|
register struct passwd *pwd;
|
||||||
|
register char *cp = sigbfr;
|
||||||
|
register char *cp2, *pp;
|
||||||
|
|
||||||
|
pwd = getpwuid(getuid());
|
||||||
|
if (pwd) {
|
||||||
|
cp2 = pwd->pw_gecos;
|
||||||
|
for (; *cp2 && *cp2 != ',' ; cp2++) {
|
||||||
|
if (*cp2 == '&') {
|
||||||
|
pp = pwd->pw_name;
|
||||||
|
*cp++ = islower(*pp) ? toupper(*pp) : *pp;
|
||||||
|
pp++;
|
||||||
|
while (*pp)
|
||||||
|
*cp++ = *pp++;
|
||||||
|
} else
|
||||||
|
*cp++ = *cp2;
|
||||||
|
}
|
||||||
|
signature = sigbfr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(¬ice, 0, sizeof(ZNotice_t));
|
||||||
|
notice.z_kind = kind;
|
||||||
|
notice.z_port = 0;
|
||||||
|
notice.z_class = class;
|
||||||
|
notice.z_class_inst = inst;
|
||||||
|
notice.z_opcode = "PING";
|
||||||
|
notice.z_sender = sender;
|
||||||
|
notice.z_message_len = 0;
|
||||||
|
notice.z_recipient = "";
|
||||||
|
notice.z_charset = ZGetCharset(charset);
|
||||||
|
if (format)
|
||||||
|
notice.z_default_format = format;
|
||||||
|
else
|
||||||
|
notice.z_default_format = "http://zephyr.1ts.org/wiki/df";
|
||||||
|
if (!nocheck && nrecips)
|
||||||
|
send_off(¬ice, 0);
|
||||||
|
|
||||||
|
if (!msgarg && isatty(0)) {
|
||||||
|
if (nodot)
|
||||||
|
printf("Type your message now. End with the end-of-file character.\n");
|
||||||
|
else
|
||||||
|
printf("Type your message now. End with control-D or a dot on a line by itself.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
message = NULL;
|
||||||
|
msgsize = 0;
|
||||||
|
if (signature) {
|
||||||
|
message = malloc((unsigned)(strlen(signature)+2));
|
||||||
|
(void) strcpy(message, signature);
|
||||||
|
msgsize = strlen(message);
|
||||||
|
message[msgsize++] = '\0';
|
||||||
|
} else {
|
||||||
|
message = malloc(1);
|
||||||
|
message[msgsize++] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cc && nrecips > 1) {
|
||||||
|
int size = msgsize;
|
||||||
|
for (arg=0;arg<nrecips;arg++)
|
||||||
|
size += (strlen(recips[arg]) + 2);
|
||||||
|
size += 6; /* for the newlines and "cc: " */
|
||||||
|
message = realloc(message, (unsigned) size);
|
||||||
|
(void) strcpy(message+msgsize, "CC: ");
|
||||||
|
msgsize += 4;
|
||||||
|
for (arg=0;arg<nrecips;arg++) {
|
||||||
|
(void) strcpy(message+msgsize, recips[arg]);
|
||||||
|
msgsize += strlen(recips[arg]);
|
||||||
|
if (arg != nrecips-1) {
|
||||||
|
message[msgsize] = ' ';
|
||||||
|
msgsize++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message[msgsize] = '\n';
|
||||||
|
msgsize += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgarg) {
|
||||||
|
int size = msgsize;
|
||||||
|
for (arg=msgarg;arg<argc;arg++)
|
||||||
|
size += (strlen(argv[arg]) + 1);
|
||||||
|
size++; /* for the newline */
|
||||||
|
message = realloc(message, (unsigned) size);
|
||||||
|
for (arg=msgarg;arg<argc;arg++) {
|
||||||
|
(void) strcpy(message+msgsize, argv[arg]);
|
||||||
|
msgsize += strlen(argv[arg]);
|
||||||
|
if (arg != argc-1) {
|
||||||
|
message[msgsize] = ' ';
|
||||||
|
msgsize++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message[msgsize] = '\n';
|
||||||
|
msgsize += 1;
|
||||||
|
} else {
|
||||||
|
if (isatty(0)) {
|
||||||
|
for (;;) {
|
||||||
|
unsigned int l;
|
||||||
|
if (!fgets(bfr, sizeof bfr, stdin))
|
||||||
|
break;
|
||||||
|
if (!nodot && bfr[0] == '.' &&
|
||||||
|
(bfr[1] == '\n' || bfr[1] == '\0'))
|
||||||
|
break;
|
||||||
|
l = strlen(bfr);
|
||||||
|
message = realloc(message, msgsize+l+1);
|
||||||
|
(void) strcpy(message+msgsize, bfr);
|
||||||
|
msgsize += l;
|
||||||
|
}
|
||||||
|
if (ferror(stdin)) /* drop the message */
|
||||||
|
exit(1);
|
||||||
|
message = realloc(message, (unsigned)(msgsize+1));
|
||||||
|
}
|
||||||
|
else { /* Use read so you can send binary messages... */
|
||||||
|
while ((nchars = read(fileno(stdin), bfr, sizeof bfr))) {
|
||||||
|
if (nchars == -1) {
|
||||||
|
fprintf(stderr, "Read error from stdin! Can't continue!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
message = realloc(message, (unsigned)(msgsize+nchars));
|
||||||
|
(void) memcpy(message+msgsize, bfr, nchars);
|
||||||
|
msgsize += nchars;
|
||||||
|
}
|
||||||
|
/* end of msg */
|
||||||
|
message = realloc(message, (unsigned)(msgsize+1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
notice.z_opcode = opcode;
|
||||||
|
if (tabexpand)
|
||||||
|
un_tabify(&message, &msgsize);
|
||||||
|
notice.z_message = message;
|
||||||
|
notice.z_message_len = msgsize;
|
||||||
|
|
||||||
|
send_off(¬ice, 1);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
send_off(ZNotice_t *notice, int real)
|
||||||
|
{
|
||||||
|
int i, success, retval;
|
||||||
|
char realm_recip[BUFSIZ], dest[3 * BUFSIZ];
|
||||||
|
ZNotice_t retnotice;
|
||||||
|
|
||||||
|
success = 0;
|
||||||
|
|
||||||
|
for (i=0;i<nrecips || i==0;i++) {
|
||||||
|
if (realm) {
|
||||||
|
sprintf(realm_recip, "%s@%s", (nrecips) ? recips[i] : "", realm);
|
||||||
|
notice->z_recipient = realm_recip;
|
||||||
|
} else {
|
||||||
|
notice->z_recipient = (nrecips) ? recips[i] : "";
|
||||||
|
}
|
||||||
|
if (nrecips)
|
||||||
|
strcpy(dest, recips[i]);
|
||||||
|
else if (!strcmp(class, DEFAULT_CLASS))
|
||||||
|
sprintf(dest, "instance \"%s\"", inst);
|
||||||
|
else if (!strcmp(inst, DEFAULT_INSTANCE))
|
||||||
|
sprintf(dest, "class \"%s\"", class);
|
||||||
|
else
|
||||||
|
sprintf(dest, "class \"%s\", instance \"%s\"", class, inst);
|
||||||
|
if (verbose && real)
|
||||||
|
printf("Sending %smessage, class %s, instance %s, to %s\n",
|
||||||
|
auth?"authenticated ":"",
|
||||||
|
class, inst,
|
||||||
|
nrecips?notice->z_recipient:"everyone");
|
||||||
|
if ((retval = ZSendNotice(notice, auth)) != ZERR_NONE) {
|
||||||
|
com_err(whoami, retval, "while sending notice to %s", dest);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (kind == UNACKED)
|
||||||
|
continue;
|
||||||
|
if (real && !quiet) {
|
||||||
|
if (verbose)
|
||||||
|
printf("Queued... ");
|
||||||
|
else
|
||||||
|
printf("Message queued for %s... ", dest);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
if ((retval = ZIfNotice(&retnotice, (struct sockaddr_in *) 0,
|
||||||
|
ZCompareUIDPred,
|
||||||
|
(char *)¬ice->z_uid)) != ZERR_NONE) {
|
||||||
|
com_err(whoami, retval, "while waiting for acknowledgement for %s",
|
||||||
|
dest);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (retnotice.z_kind == SERVNAK) {
|
||||||
|
if (!quiet) {
|
||||||
|
printf("Received authorization failure while sending to %s\n",
|
||||||
|
dest);
|
||||||
|
}
|
||||||
|
ZFreeNotice(&retnotice);
|
||||||
|
break; /* if auth fails, punt */
|
||||||
|
}
|
||||||
|
if (retnotice.z_kind != SERVACK || !retnotice.z_message_len) {
|
||||||
|
if (!quiet) {
|
||||||
|
printf("Detected server failure while receiving acknowledgement for %s\n",
|
||||||
|
dest);
|
||||||
|
}
|
||||||
|
ZFreeNotice(&retnotice);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(retnotice.z_message, ZSRVACK_SENT)) {
|
||||||
|
success = 1;
|
||||||
|
if (real && !quiet)
|
||||||
|
printf("sent\n");
|
||||||
|
} else if (!strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) {
|
||||||
|
if (verbose && real && !quiet) {
|
||||||
|
if (strcmp(class, DEFAULT_CLASS)) {
|
||||||
|
fprintf(stderr, "Not logged in or not subscribing to class %s, instance %s\n",
|
||||||
|
class, inst);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr,
|
||||||
|
"Not logged in or not subscribing to messages\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!quiet) {
|
||||||
|
if (!nrecips) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"No one subscribing to class %s, instance %s\n",
|
||||||
|
class, inst);
|
||||||
|
} else {
|
||||||
|
if (strcmp(class, DEFAULT_CLASS)) {
|
||||||
|
fprintf(stderr, "%s: Not logged in or not subscribing to class %s, instance %s\n",
|
||||||
|
notice->z_recipient, class, inst);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%s: Not logged in or not subscribing to messages\n",
|
||||||
|
notice->z_recipient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("Internal failure - illegal message field in server response\n");
|
||||||
|
ZFreeNotice(&retnotice);
|
||||||
|
}
|
||||||
|
if (!success)
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
usage(char *s)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Usage: %s [-a] [-o] [-d] [-v] [-q] [-n] [-t] [-u] [-l]\n\
|
||||||
|
\t[-c class] [-i inst] [-O opcode] [-f fsname] [-s signature] [-C]\n\
|
||||||
|
\t[user ...] [-F format] [-r realm] [-x charset] [-m message]\n", s);
|
||||||
|
fprintf(stderr,"\t-f and -c are mutually exclusive\n\
|
||||||
|
\t-f and -i are mutually exclusive\n\
|
||||||
|
\trecipients must be specified unless -c or -f specifies a class\n\
|
||||||
|
\tother than the default class or -i or -f specifies an instance\n\
|
||||||
|
\tother than the default or urgent instance\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if the -f option is specified, this routine is called to canonicalize
|
||||||
|
an instance of the form hostname[:pack]. It turns the hostname into the
|
||||||
|
name returned by gethostbyname(hostname)
|
||||||
|
*/
|
||||||
|
|
||||||
|
char *
|
||||||
|
fix_filsrv_inst(char *str)
|
||||||
|
{
|
||||||
|
static char fsinst[BUFSIZ];
|
||||||
|
char *ptr;
|
||||||
|
struct hostent *hp;
|
||||||
|
|
||||||
|
ptr = strchr(str,':');
|
||||||
|
if (ptr)
|
||||||
|
*ptr = '\0';
|
||||||
|
|
||||||
|
hp = gethostbyname(str);
|
||||||
|
if (!hp) {
|
||||||
|
if (ptr)
|
||||||
|
*ptr = ':';
|
||||||
|
return(str);
|
||||||
|
}
|
||||||
|
(void) strcpy(fsinst, hp->h_name);
|
||||||
|
if (ptr) {
|
||||||
|
(void) strcat(fsinst, ":");
|
||||||
|
ptr++;
|
||||||
|
(void) strcat(fsinst, ptr);
|
||||||
|
}
|
||||||
|
return(fsinst);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* convert tabs in the buffer into appropriate # of spaces.
|
||||||
|
slightly tricky since the buffer can have NUL's in it. */
|
||||||
|
|
||||||
|
#ifndef TABSTOP
|
||||||
|
#define TABSTOP 8 /* #chars between tabstops */
|
||||||
|
#endif /* ! TABSTOP */
|
||||||
|
|
||||||
|
void
|
||||||
|
un_tabify(char **bufp,
|
||||||
|
int *sizep)
|
||||||
|
{
|
||||||
|
register char *cp, *cp2;
|
||||||
|
char *cp3;
|
||||||
|
register int i;
|
||||||
|
register int column; /* column of next character */
|
||||||
|
register int size = *sizep;
|
||||||
|
|
||||||
|
for (cp = *bufp, i = 0; size; size--, cp++)
|
||||||
|
if (*cp == '\t')
|
||||||
|
i++; /* count tabs in buffer */
|
||||||
|
|
||||||
|
if (!i)
|
||||||
|
return; /* no tabs == no work */
|
||||||
|
|
||||||
|
/* To avoid allocation churning, allocate enough extra space to convert
|
||||||
|
every tab into TABSTOP spaces */
|
||||||
|
/* only add (TABSTOP-1)x because we re-use the cell holding the
|
||||||
|
tab itself */
|
||||||
|
cp = malloc((unsigned)(*sizep + (i * (TABSTOP-1))));
|
||||||
|
if (!cp) /* XXX */
|
||||||
|
return; /* punt expanding if memory fails */
|
||||||
|
cp3 = cp;
|
||||||
|
/* Copy buffer, converting tabs to spaces as we go */
|
||||||
|
for (cp2 = *bufp, column = 1, size = *sizep; size; cp2++, size--) {
|
||||||
|
switch (*cp2) {
|
||||||
|
case '\n':
|
||||||
|
case '\0':
|
||||||
|
/* newline or null: reset column */
|
||||||
|
column = 1;
|
||||||
|
*cp++ = *cp2; /* copy the newline */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* copy the character */
|
||||||
|
*cp = *cp2;
|
||||||
|
cp++;
|
||||||
|
column++;
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
/* it's a tab, compute how many spaces to expand into. */
|
||||||
|
i = TABSTOP - ((column - 1) % TABSTOP);
|
||||||
|
for (; i > 0; i--) {
|
||||||
|
*cp++ = ' '; /* fill in the spaces */
|
||||||
|
column++;
|
||||||
|
(*sizep)++; /* increment the size */
|
||||||
|
}
|
||||||
|
(*sizep)--; /* remove one (we replaced the tab) */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(*bufp); /* free the old buf */
|
||||||
|
*bufp = cp3;
|
||||||
|
return;
|
||||||
|
}
|
414
configure.ac
Normal file
414
configure.ac
Normal file
@ -0,0 +1,414 @@
|
|||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_INIT([zephyr],[__DEV__])
|
||||||
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
|
test -d h || mkdir h
|
||||||
|
test -d h/zephyr || mkdir h/zephyr
|
||||||
|
|
||||||
|
test -z "$lbindir" && lbindir='${bindir}'
|
||||||
|
test -z "$lsbindir" && lsbindir='${sbindir}'
|
||||||
|
AC_SUBST(lbindir)
|
||||||
|
AC_SUBST(lsbindir)
|
||||||
|
|
||||||
|
AC_CANONICAL_SYSTEM
|
||||||
|
AC_CANONICAL_TARGET
|
||||||
|
AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$host", [Define to the type of the host system.])
|
||||||
|
|
||||||
|
dnl Checks for programs.
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_YACC
|
||||||
|
AC_PROG_LEX
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_PROG_LIBTOOL
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(location of temporary directory)
|
||||||
|
if test -d /var/tmp; then
|
||||||
|
found_tmp=/var/tmp/
|
||||||
|
elif test -d /usr/tmp; then
|
||||||
|
found_tmp=/usr/tmp/
|
||||||
|
else
|
||||||
|
found_tmp=/tmp/
|
||||||
|
fi
|
||||||
|
AC_DEFINE_UNQUOTED(FOUND_TMP, "${found_tmp}", [Define to a temporary directory on your system.])
|
||||||
|
AC_MSG_RESULT(${found_tmp})
|
||||||
|
|
||||||
|
dnl Checks for header files.
|
||||||
|
AC_PATH_XTRA
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_HEADER_SYS_WAIT
|
||||||
|
AC_CHECK_HEADERS(fcntl.h paths.h sgtty.h unistd.h malloc.h)
|
||||||
|
AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h sys/time.h sys/file.h sys/utsname.h)
|
||||||
|
AC_CHECK_HEADERS(sys/select.h sys/msgbuf.h sys/cdefs.h krb5_err.h termcap.h)
|
||||||
|
AC_CHECK_HEADERS(arpa/nameser_compat.h stdbool.h termio.h curses.h)
|
||||||
|
AC_CHECK_HEADERS([term.h], [], [],
|
||||||
|
[#ifdef HAVE_CURSES_H
|
||||||
|
#include <curses.h>
|
||||||
|
#endif
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "$no_x" != "yes"; then
|
||||||
|
ZWGC_LIBX11=-lX11
|
||||||
|
fi
|
||||||
|
AC_SUBST(XCLIENTS)
|
||||||
|
AC_SUBST(ZWGC_LIBX11)
|
||||||
|
|
||||||
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
AC_TYPE_SIGNAL
|
||||||
|
AC_TYPE_UID_T
|
||||||
|
AC_CHECK_SIZEOF(short)
|
||||||
|
AC_CHECK_SIZEOF(int)
|
||||||
|
AC_CHECK_SIZEOF(long)
|
||||||
|
AC_MSG_CHECKING(for 32-bit integer type)
|
||||||
|
if test "$ac_cv_sizeof_long" = 4; then
|
||||||
|
int32=long
|
||||||
|
elif test "$ac_cv_sizeof_int" = 4; then
|
||||||
|
int32=int
|
||||||
|
elif test "$ac_cv_sizeof_short" = 4; then
|
||||||
|
int32=short
|
||||||
|
else
|
||||||
|
AC_WARN([Can't find 32-bit type, using long])
|
||||||
|
int32=long
|
||||||
|
fi
|
||||||
|
AC_DEFINE_UNQUOTED(ZEPHYR_INT32, ${int32}, [Define to a signed 32-bit integral type.])
|
||||||
|
AC_MSG_RESULT(${int32})
|
||||||
|
|
||||||
|
AC_CHECK_LIB(w, wslen)
|
||||||
|
# XXX? AC_CHECK_LIB(dl, dlopen)
|
||||||
|
|
||||||
|
AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
|
||||||
|
[AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1,
|
||||||
|
[sockaddr_in has sin_len member])],
|
||||||
|
[], [
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
|
||||||
|
[AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_LEN, 1,
|
||||||
|
[sockaddr_in6 has sin6_len member])],
|
||||||
|
[], [
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||||
|
AC_SEARCH_LIBS(socket, socket)
|
||||||
|
|
||||||
|
AC_CHECK_LIB(44bsd, strerror)
|
||||||
|
|
||||||
|
AC_ARG_WITH(libiconv,
|
||||||
|
[ --with-libiconv=PREFIX Location for libiconv],
|
||||||
|
[libiconv="$withval"], [libiconv=no])
|
||||||
|
if test "$libiconv" != no; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$libiconv/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$libiconv/lib"
|
||||||
|
AC_CHECK_LIB(iconv, iconv_open, [LIBICONV=-liconv; AC_SUBST(LIBICONV)])
|
||||||
|
else
|
||||||
|
AC_CHECK_FUNC(iconv_open, :,
|
||||||
|
AC_CHECK_LIB(iconv, iconv_open, [LIBICONV=-liconv; AC_SUBST(LIBICONV)]))
|
||||||
|
fi
|
||||||
|
AC_SUBST(LIBICONV)
|
||||||
|
|
||||||
|
AC_CHECK_LIB(curses, tgetstr, [TLIB=-lcurses], [TLIB=-ltermcap])
|
||||||
|
AC_SUBST(TLIB)
|
||||||
|
|
||||||
|
AC_ARG_WITH(krb4,
|
||||||
|
[ --with-krb4=PREFIX Use Kerberos 4],
|
||||||
|
[krb4="$withval"], [krb4=no])
|
||||||
|
if test "$krb4" != no; then
|
||||||
|
AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname))
|
||||||
|
AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket))
|
||||||
|
AC_CHECK_LIB(gen, compile)
|
||||||
|
if test "$krb4" != yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$krb4/include"
|
||||||
|
if test -d "$krb4/include/kerberosIV"; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV"
|
||||||
|
fi
|
||||||
|
LDFLAGS="$LDFLAGS -L$krb4/lib"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(krb4, krb_rd_req,
|
||||||
|
[KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
|
||||||
|
[AC_CHECK_LIB(des, des_quad_cksum,
|
||||||
|
[KRB4_DES_LIBS="-ldes"],,,)
|
||||||
|
AC_CHECK_LIB(krb, krb_rd_req,
|
||||||
|
[KRB4_LIBS="-lkrb $KRB4_DES_LIBS"],
|
||||||
|
[AC_MSG_ERROR(Kerberos 4 libraries not found)],
|
||||||
|
$KRB4_DES_LIBS)],
|
||||||
|
-ldes425 -lkrb5 -lk5crypto -lcom_err)
|
||||||
|
AC_DEFINE(HAVE_KRB4, 1, [Define to compile with Kerberos support.])
|
||||||
|
LIBZEPHYR_LIBS="$LIBZEPHYR_LIBS $KRB4_LIBS"
|
||||||
|
fi
|
||||||
|
AC_SUBST(KRB4_LIBS)
|
||||||
|
|
||||||
|
AC_ARG_WITH(krb5,
|
||||||
|
[ --with-krb5=PREFIX Use Kerberos 5],
|
||||||
|
[krb5="$withval"], [krb5=no])
|
||||||
|
if test "$krb5" != no; then
|
||||||
|
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||||
|
AC_SEARCH_LIBS(socket, socket)
|
||||||
|
AC_CHECK_LIB(gen, compile)
|
||||||
|
if test "$krb5" != yes; then
|
||||||
|
PATH="$krb5/bin:$PATH"
|
||||||
|
fi
|
||||||
|
AC_CHECK_PROG(krb5config, krb5-config,yes)
|
||||||
|
if test "$krb5config" = yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS $(krb5-config --cflags krb5)"
|
||||||
|
KRB5_LIBS="$(krb5-config --libs krb5)"
|
||||||
|
else
|
||||||
|
if test "$krb5" != yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$krb5/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$krb5/lib"
|
||||||
|
fi
|
||||||
|
KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
|
||||||
|
fi
|
||||||
|
AC_CHECK_HEADER(krb5.h, :, [AC_MSG_ERROR(Kerberos 5 headers not found)])
|
||||||
|
local_save_LIBS=$LIBS
|
||||||
|
LIBS="$libs $KRB5_LIBS"
|
||||||
|
AC_CHECK_FUNC(krb5_init_context, :,
|
||||||
|
[AC_MSG_ERROR(Kerberos 5 libraries not found)])
|
||||||
|
LIBS="$local_save_LIBS"
|
||||||
|
AC_DEFINE(HAVE_KRB5, 1, [Define to compile with Kerberos 5 support.])
|
||||||
|
LIBZEPHYR_LIBS="$LIBZEPHYR_LIBS $KRB5_LIBS"
|
||||||
|
case "$target_os" in
|
||||||
|
darwin*) KRB5_LIBS="$KRB5_LIBS -framework Kerberos" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH(hesiod,
|
||||||
|
[ --with-hesiod=PREFIX Use Hesiod],
|
||||||
|
[hesiod="$withval"], [hesiod=no])
|
||||||
|
|
||||||
|
if test "$krb5" != no || test "$hesiod" != no; then
|
||||||
|
# the zephyr library needs -lresolv if it's built with krb5 or hesiod
|
||||||
|
AC_CHECK_LIB([resolv], [res_mkquery], [], [
|
||||||
|
AC_MSG_CHECKING([if res_mkquery is provided by libresolv with mangled symbols])
|
||||||
|
save_LIBS="$LIBS"
|
||||||
|
LIBS="-lresolv $LIBS"
|
||||||
|
AC_TRY_LINK([#include <resolv.h>],
|
||||||
|
[res_mkquery(0,NULL,0,0,NULL,0,NULL,NULL,0);], [
|
||||||
|
AC_DEFINE(HAVE_LIBRESOLV, [1], [Define if your libresolv provides res_mkquery.])
|
||||||
|
LIBZEPHYR_LIBS="-lresolv $LIBZEPHYR_LIBS"
|
||||||
|
AC_MSG_RESULT(yes)], [
|
||||||
|
LIBS="$save_LIBS"
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_ERROR(Zephyr requires libresolv along with Kerberos V or Hesiod.)
|
||||||
|
])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(KRB5_LIBS)
|
||||||
|
|
||||||
|
AC_SUBST(LIBZEPHYR_LIBS)
|
||||||
|
if test "$hesiod" != no; then
|
||||||
|
if test "$hesiod" != yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$hesiod/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$hesiod/lib"
|
||||||
|
fi
|
||||||
|
AC_CHECK_FUNC(hes_resolve, :,
|
||||||
|
AC_CHECK_LIB(hesiod, hes_resolve, HESIOD_LIBS="-lhesiod",
|
||||||
|
[AC_MSG_ERROR(Hesiod library not found)],$LIBS))
|
||||||
|
AC_DEFINE(HAVE_HESIOD, 1, [Define to compile with Hesiod support.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(HESIOD_LIBS)
|
||||||
|
|
||||||
|
AC_ARG_WITH(regex,
|
||||||
|
[ --with-regex=PREFIX Use installed regex library],
|
||||||
|
[regex="$withval"], [regex=no])
|
||||||
|
if test "$regex" != no; then
|
||||||
|
if test "$regex" != yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$regex/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$regex/lib"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(regex, regcomp, REGEX_LIBS=-lregex,
|
||||||
|
[AC_MSG_ERROR(regex library not found)])
|
||||||
|
else
|
||||||
|
AC_CHECK_FUNC(regcomp, :,
|
||||||
|
[AC_MSG_ERROR(can't find POSIX regexp support)])
|
||||||
|
fi
|
||||||
|
AC_SUBST(REGEX_LIBS)
|
||||||
|
|
||||||
|
AC_ARG_WITH(com_err,
|
||||||
|
[ --with-com_err=PREFIX Specify location of com_err],
|
||||||
|
[com_err="$withval"], [com_err=yes])
|
||||||
|
if test "$com_err" != no; then
|
||||||
|
if test "$com_err" != yes; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$com_err/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$com_err/lib"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(com_err, com_err, :,
|
||||||
|
[AC_MSG_ERROR(com_err library not found)])
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR(This package requires com_err.)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH(ss,
|
||||||
|
[ --with-ss=PREFIX Specify location of ss (requires com_err)],
|
||||||
|
[ss="$withval"], [ss=maybe])
|
||||||
|
if test "$ss" != no; then
|
||||||
|
if test "$ss" != yes -a "$ss" != maybe; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$ss/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L$ss/lib"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(ss, ss_perror,
|
||||||
|
[SS_LIBS="-lss"
|
||||||
|
AC_DEFINE(HAVE_SS, 1, [Define if we are building with the ss library])],
|
||||||
|
AS_IF([test "x$ss" != "xmaybe"], AC_MSG_ERROR(ss library not found)),
|
||||||
|
-lcom_err)
|
||||||
|
SS_OBJS='${SS_OBJS}'
|
||||||
|
fi
|
||||||
|
AC_SUBST(SS_LIBS)
|
||||||
|
AC_SUBST(SS_OBJS)
|
||||||
|
|
||||||
|
LIBS="$KRB5_LIBS $KRB4_LIBS $LIBS"
|
||||||
|
|
||||||
|
dnl Checks for library functions.
|
||||||
|
#XXX more looking for res_send
|
||||||
|
#AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send))
|
||||||
|
|
||||||
|
AC_ARG_WITH([cares], AS_HELP_STRING([--with-cares], [Use libcares]))
|
||||||
|
if test "x$with_ares" != "xno"; then
|
||||||
|
AC_CHECK_LIB(cares, ares_getnameinfo,
|
||||||
|
[ARES_LIBS="-lcares"
|
||||||
|
AC_DEFINE(HAVE_ARES, 1, [Define to compile with c-ares support.])],
|
||||||
|
AS_IF([test "x$with_ares" = "xyes"],
|
||||||
|
AC_MSG_ERROR(libcares not found)))
|
||||||
|
fi
|
||||||
|
AC_SUBST(ARES_LIBS)
|
||||||
|
|
||||||
|
AC_PROG_GCC_TRADITIONAL
|
||||||
|
AC_FUNC_VPRINTF
|
||||||
|
AC_FUNC_GETPGRP
|
||||||
|
AC_FUNC_SETPGRP
|
||||||
|
AC_CHECK_FUNCS(putenv strchr memcpy memmove waitpid getlogin strerror random)
|
||||||
|
AC_CHECK_FUNCS(lrand48 gethostid getsid getpgid etext)
|
||||||
|
AC_CHECK_FUNCS(krb_get_err_text krb_log)
|
||||||
|
AC_CHECK_FUNCS(krb5_free_data krb5_c_make_checksum krb5_cc_set_default_name)
|
||||||
|
AC_CHECK_FUNCS(krb5_crypto_init krb5_c_decrypt krb5_free_unparsed_name)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(krb5_auth_con_getauthenticator out argument type)
|
||||||
|
AC_CACHE_VAL(ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer, [
|
||||||
|
local_save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${KRB5_INC_FLAGS}"
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <krb5.h>
|
||||||
|
krb5_error_code
|
||||||
|
krb5_auth_con_getauthenticator(krb5_context context,
|
||||||
|
krb5_auth_context auth_context,
|
||||||
|
krb5_authenticator *authenticator);],
|
||||||
|
[krb5_error_code foo = krb5_auth_con_getauthenticator(0, 0, 0);],
|
||||||
|
ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer=no,
|
||||||
|
[AC_TRY_COMPILE(
|
||||||
|
[#include <krb5.h>
|
||||||
|
krb5_error_code
|
||||||
|
krb5_auth_con_getauthenticator(krb5_context context,
|
||||||
|
krb5_auth_context auth_context,
|
||||||
|
krb5_authenticator **authenticator);],
|
||||||
|
[krb5_error_code foo = krb5_auth_con_getauthenticator(0, 0, 0);],
|
||||||
|
ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer=yes,
|
||||||
|
[AC_MSG_ERROR([Cannot identify krb5_auth_con_getauthenticator function signature])]
|
||||||
|
)])
|
||||||
|
CPPFLAGS="${local_save_CPPFLAGS}"
|
||||||
|
])
|
||||||
|
krb5_authent_type='krb5_authenticator *'
|
||||||
|
if test "$ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer" = yes; then
|
||||||
|
AC_DEFINE(KRB5_AUTH_CON_GETAUTHENTICATOR_TAKES_DOUBLE_POINTER, 1,
|
||||||
|
[Define if `krb5_auth_con_getauthenticator' takes a double pointer third arg.])dnl
|
||||||
|
krb5_authent_type='krb5_authenticator **'
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($krb5_authent_type)
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([krb5_auth_con_getflags out argument type],
|
||||||
|
[ac_cv_krb5_auth_con_flags_type], [
|
||||||
|
local_save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${KRB5_INC_FLAGS}"
|
||||||
|
for t in krb5_flags int32_t ; do
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <krb5.h>
|
||||||
|
extern krb5_error_code
|
||||||
|
krb5_auth_con_getflags(krb5_context, krb5_auth_context, $t *);],
|
||||||
|
[krb5_error_code foo = krb5_auth_con_getflags(0, 0, 0);],
|
||||||
|
[ac_cv_krb5_auth_con_flags_type=$t; break])
|
||||||
|
done
|
||||||
|
CPPFLAGS="${local_save_CPPFLAGS}"
|
||||||
|
if test "x$ac_cv_krb5_auth_con_flags_type" = x ; then
|
||||||
|
AC_MSG_ERROR([Cannot identify krb5_auth_con_getflags function signature])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
AC_DEFINE_UNQUOTED([KRB5_AUTH_CON_FLAGS_TYPE],
|
||||||
|
[$ac_cv_krb5_auth_con_flags_type],
|
||||||
|
[krb5_auth_con_getflags() output arg type])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for enc_part2 in struct krb5_ticket)
|
||||||
|
AC_CACHE_VAL(ac_cv_have_krb5_ticket_enc_part2, [
|
||||||
|
local_save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${KRB5_INC_FLAGS}"
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <krb5.h>], [krb5_ticket _tkt; _tkt.enc_part2;],
|
||||||
|
ac_cv_have_krb5_ticket_enc_part2=yes,
|
||||||
|
ac_cv_have_krb5_ticket_enc_part2=no)
|
||||||
|
])
|
||||||
|
CPPFLAGS="${local_save_CPPFLAGS}"
|
||||||
|
if test "$ac_cv_have_krb5_ticket_enc_part2" = yes; then
|
||||||
|
AC_DEFINE(HAVE_KRB5_TICKET_ENC_PART2, 1,
|
||||||
|
[Define to 1 if `enc_part2' is member of `krb5_ticket'.])dnl
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($ac_cv_have_krb5_ticket_enc_part2)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for enctype in struct krb5_keyblock)
|
||||||
|
AC_CACHE_VAL(ac_cv_have_krb5_creds_keyblock_enctype, [
|
||||||
|
local_save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${KRB5_INC_FLAGS}"
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <krb5.h>], [krb5_creds _creds; _creds.keyblock.enctype;],
|
||||||
|
ac_cv_have_krb5_creds_keyblock_enctype=yes,
|
||||||
|
ac_cv_have_krb5_creds_keyblock_enctype=no)
|
||||||
|
])
|
||||||
|
CPPFLAGS="${local_save_CPPFLAGS}"
|
||||||
|
if test "$ac_cv_have_krb5_creds_keyblock_enctype" = yes; then
|
||||||
|
AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE, 1,
|
||||||
|
[Define if `keyblock.enctype' is member of `krb5_creds'.])dnl
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($ac_cv_have_krb5_creds_keyblock_enctype)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(cmu-zwgcplus,
|
||||||
|
[ --enable-cmu-zwgcplus enable CMU zwgcplus extensions],[
|
||||||
|
if test "$enableval" = "yes"; then
|
||||||
|
AC_DEFINE(CMU_ZWGCPLUS, 1, [Define to enable zwgcplus support])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(cmu-zctl-punt,
|
||||||
|
[ --enable-cmu-zctl-punt enable CMU zctl punt extensions],[
|
||||||
|
if test "$enableval" = "yes"; then
|
||||||
|
AC_DEFINE(CMU_ZCTL_PUNT, 1,
|
||||||
|
[Define to pull in CMU zctl punt backward compat foo])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(cmu-hm-flush-restrict,
|
||||||
|
[ --enable-cmu-hm-flush-restrict enable CMU zctl hm flush restriction],[
|
||||||
|
if test "$enableval" = "yes"; then
|
||||||
|
AC_DEFINE(HM_FLUSH_RESTRICT, 1,
|
||||||
|
[Define to get hm_flush restrictions in zctl])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(cmu-opstaff-locate-self,
|
||||||
|
[ --enable-cmu-opstaff-locate-self enable CMU opstaff locate-self ability],[
|
||||||
|
if test "$enableval" = "yes"; then
|
||||||
|
AC_DEFINE(OPSTAFF_LOCATE_SELF, 1,
|
||||||
|
[Define to allow users to locate themselves if they are opstaff])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CONFIG_HEADER(h/config.h)
|
||||||
|
AC_OUTPUT(Makefile clients/Makefile clients/zaway/Makefile
|
||||||
|
clients/zctl/Makefile clients/zleave/Makefile
|
||||||
|
clients/zlocate/Makefile clients/znol/Makefile
|
||||||
|
clients/zshutdown_notify/Makefile clients/zstat/Makefile
|
||||||
|
clients/zwrite/Makefile lib/Makefile
|
||||||
|
server/Makefile zhm/Makefile zwgc/Makefile
|
||||||
|
zephyr.pc
|
||||||
|
)
|
233
contrib/zephyr-dissector.lua
Normal file
233
contrib/zephyr-dissector.lua
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
-- Wireshark dissector for Zephyr
|
||||||
|
-- Place in ~/.local/lib/wireshark/plugins/2.6/
|
||||||
|
|
||||||
|
zephyr_protocol = Proto("Zephyr", "Zephyr IM Protocol")
|
||||||
|
|
||||||
|
local kind_names = {
|
||||||
|
[0] = "UNSAFE",
|
||||||
|
[1] = "UNACKED",
|
||||||
|
[2] = "ACKED",
|
||||||
|
[3] = "HMACK",
|
||||||
|
[4] = "HMCTL",
|
||||||
|
[5] = "SERVACK",
|
||||||
|
[6] = "SERVNAK",
|
||||||
|
[7] = "CLIENTACK",
|
||||||
|
[8] = "STAT"
|
||||||
|
}
|
||||||
|
zephyr_protocol.fields.version = ProtoField.stringz("zephyr.version", "Version")
|
||||||
|
zephyr_protocol.fields.numfields = ProtoField.uint32("zephyr.fields", "Field Count")
|
||||||
|
zephyr_protocol.fields.z_kind = ProtoField.uint32("zephyr.z_kind", "Kind", base.DEC, kind_names)
|
||||||
|
zephyr_protocol.fields.z_uid = ProtoField.stringz("zephyr.z_uid", "UID")
|
||||||
|
zephyr_protocol.fields.z_uid_addr = ProtoField.ipv4("zephyr.z_uid.zuid_addr", "Address")
|
||||||
|
zephyr_protocol.fields.z_uid_tv = ProtoField.absolute_time("zephyr.z_uid.tv", "Time")
|
||||||
|
zephyr_protocol.fields.z_port = ProtoField.uint16("zephyr.z_port", "Port")
|
||||||
|
zephyr_protocol.fields.z_auth = ProtoField.uint32("zephyr.z_auth", "Auth")
|
||||||
|
zephyr_protocol.fields.z_authent_len = ProtoField.uint32("zephyr.z_authent_len", "Authenticator Length")
|
||||||
|
zephyr_protocol.fields.z_ascii_authent = ProtoField.stringz("zephyr.z_ascii_authent", "Authenticator")
|
||||||
|
zephyr_protocol.fields.z_class = ProtoField.stringz("zephyr.z_class", "Class")
|
||||||
|
zephyr_protocol.fields.z_class_inst = ProtoField.stringz("zephyr.z_class_inst", "Instance")
|
||||||
|
zephyr_protocol.fields.z_opcode = ProtoField.stringz("zephyr.z_opcode", "Opcode")
|
||||||
|
zephyr_protocol.fields.z_sender = ProtoField.stringz("zephyr.z_sender", "Sender")
|
||||||
|
zephyr_protocol.fields.z_recipient = ProtoField.stringz("zephyr.z_recipient", "Recipient")
|
||||||
|
zephyr_protocol.fields.z_default_format = ProtoField.stringz("zephyr.z_default_format", "Default Format")
|
||||||
|
zephyr_protocol.fields.z_ascii_checksum = ProtoField.stringz("zephyr.z_ascii_checksum", "ASCII Checksum")
|
||||||
|
zephyr_protocol.fields.z_checksum = ProtoField.uint32("zephyr.z_checksum", "Checksum")
|
||||||
|
zephyr_protocol.fields.z_multinotice = ProtoField.stringz("zephyr.z_multinotice", "Multinotice")
|
||||||
|
zephyr_protocol.fields.z_multiuid = ProtoField.stringz("zephyr.z_multiuid", "MultiUID")
|
||||||
|
zephyr_protocol.fields.z_multiuid_addr = ProtoField.ipv4("zephyr.z_multiuid.zuid_addr", "Address")
|
||||||
|
zephyr_protocol.fields.z_multiuid_tv = ProtoField.absolute_time("zephyr.z_multiuid.tv", "Time")
|
||||||
|
zephyr_protocol.fields.z_sender_sockaddr = ProtoField.ipv4("zephyr.z_sender_sockaddr", "Sender sockaddr")
|
||||||
|
zephyr_protocol.fields.z_charset = ProtoField.uint16("zephyr.z_charset", "Character Set")
|
||||||
|
zephyr_protocol.fields.z_message = ProtoField.string("zephyr.z_message", "Message")
|
||||||
|
zephyr_protocol.fields.z_message_len = ProtoField.uint32("zephyr.z_message_len", "Message Length")
|
||||||
|
|
||||||
|
function parse_ascii(range)
|
||||||
|
local v = range(2):string()
|
||||||
|
return tonumber(string.match(v, "[0-9A-F]+"), 16)
|
||||||
|
end
|
||||||
|
|
||||||
|
function parse_ascii_ip(range)
|
||||||
|
local ip = "" .. tonumber(range(2, 2):string(), 16) .. "." .. tonumber(range(4, 2):string(), 16) .. "." .. tonumber(range(6, 2):string(), 16) .. "." .. tonumber(range(8, 2):string(), 16)
|
||||||
|
return Address.ip(ip)
|
||||||
|
end
|
||||||
|
|
||||||
|
function parse_zcode_ip(range)
|
||||||
|
local bytes = {}
|
||||||
|
local str = range(1,range:len()-2):bytes()
|
||||||
|
local i = 0
|
||||||
|
while i < str:len() do
|
||||||
|
local byte = str:get_index(i)
|
||||||
|
info(i .. ": " .. byte)
|
||||||
|
if (byte == 0xFF) then
|
||||||
|
if (str:get_index(i+1) == 0xF0) then
|
||||||
|
table.insert(bytes, 0)
|
||||||
|
elseif (str:get_index(i+1) == 0xF1) then
|
||||||
|
table.insert(bytes, 0xFF)
|
||||||
|
end
|
||||||
|
i = i + 2
|
||||||
|
else
|
||||||
|
table.insert(bytes, byte)
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
info(bytes[1])
|
||||||
|
info(table.concat(bytes, "."))
|
||||||
|
return Address.ip(table.concat(bytes, "."))
|
||||||
|
end
|
||||||
|
|
||||||
|
function parse_ascii_tv(range)
|
||||||
|
info(range:string())
|
||||||
|
local seconds = parse_ascii(range)
|
||||||
|
local microseconds = parse_ascii(range(11))
|
||||||
|
return NSTime.new(seconds, microseconds*1000)
|
||||||
|
end
|
||||||
|
|
||||||
|
function zephyr_protocol.dissector(buffer, pinfo, tree)
|
||||||
|
length = buffer:len()
|
||||||
|
if length == 0 then return end
|
||||||
|
|
||||||
|
pinfo.cols.protocol = zephyr_protocol.name
|
||||||
|
|
||||||
|
local subtree = tree:add(zephyr_protocol, buffer(), "Zephyr")
|
||||||
|
|
||||||
|
local range = buffer()
|
||||||
|
local length = range:strsize()
|
||||||
|
local v = range:stringz()
|
||||||
|
subtree:add(zephyr_protocol.fields.version, range)
|
||||||
|
|
||||||
|
if v == "ZEPH0.2" then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
local numfields = parse_ascii(range)
|
||||||
|
subtree:add(zephyr_protocol.fields.numfields, range, numfields)
|
||||||
|
numfields = numfields - 2
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
local kind = parse_ascii(range)
|
||||||
|
subtree:add(zephyr_protocol.fields.z_kind, range, kind)
|
||||||
|
numfields = numfields - 1
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
local z_uid = subtree:add(zephyr_protocol.fields.z_uid, range)
|
||||||
|
|
||||||
|
local addr = parse_ascii_ip(range)
|
||||||
|
local tv = parse_ascii_tv(range(11))
|
||||||
|
z_uid:add(zephyr_protocol.fields.z_uid_addr, range(0, 11), addr)
|
||||||
|
z_uid:add(zephyr_protocol.fields.z_uid_tv, range(11), tv)
|
||||||
|
z_uid:set_text("UID: " .. tostring(addr) .. " " .. tostring(tv))
|
||||||
|
|
||||||
|
numfields = numfields - 1
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_port, range, parse_ascii(range))
|
||||||
|
numfields = numfields - 1
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_auth, range, parse_ascii(range))
|
||||||
|
numfields = numfields - 1
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
local authent_length = parse_ascii(range)
|
||||||
|
subtree:add(zephyr_protocol.fields.z_authent_len, range, authent_length)
|
||||||
|
numfields = numfields - 1
|
||||||
|
|
||||||
|
function add(field)
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
subtree:add(field, range)
|
||||||
|
numfields = numfields - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
add(zephyr_protocol.fields.z_ascii_authent)
|
||||||
|
add(zephyr_protocol.fields.z_class)
|
||||||
|
local class = range:stringz()
|
||||||
|
add(zephyr_protocol.fields.z_class_inst)
|
||||||
|
local instance = range:stringz()
|
||||||
|
add(zephyr_protocol.fields.z_opcode)
|
||||||
|
local opcode = range:stringz()
|
||||||
|
add(zephyr_protocol.fields.z_sender)
|
||||||
|
add(zephyr_protocol.fields.z_recipient)
|
||||||
|
add(zephyr_protocol.fields.z_default_format)
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_ascii_checksum, range)
|
||||||
|
local status, value = pcall(function() return parse_ascii(range) end)
|
||||||
|
if status then
|
||||||
|
subtree:add(zephyr_protocol.fields.z_checksum, range, value)
|
||||||
|
end
|
||||||
|
numfields = numfields - 1
|
||||||
|
-- TODO: validate checksum and flag if wrong
|
||||||
|
end
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_multinotice, range)
|
||||||
|
numfields = numfields - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
local z_multiuid = subtree:add(zephyr_protocol.fields.z_multiuid, range)
|
||||||
|
|
||||||
|
local addr = parse_ascii_ip(range)
|
||||||
|
local tv = parse_ascii_tv(range(11))
|
||||||
|
z_multiuid:add(zephyr_protocol.fields.z_multiuid_addr, range(0, 11), addr)
|
||||||
|
z_multiuid:add(zephyr_protocol.fields.z_multiuid_tv, range(11), tv)
|
||||||
|
z_multiuid:set_text("MultiUID: " .. tostring(addr) .. " " .. tostring(tv))
|
||||||
|
numfields = numfields - 1
|
||||||
|
-- else z_multiuid = z_uid
|
||||||
|
end
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
if (range:string():byte(1) == 90) then
|
||||||
|
-- TODO: parse Zcode address for real
|
||||||
|
subtree:add(zephyr_protocol.fields.z_sender_sockaddr, range, parse_zcode_ip(range)):append_text(" (Zcode)")
|
||||||
|
else
|
||||||
|
subtree:add(zephyr_protocol.fields.z_sender_sockaddr, range, parse_ascii_ip(range)):append_text(" (NetASCII)")
|
||||||
|
end
|
||||||
|
numfields = numfields - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_charset, range, parse_ascii(range))
|
||||||
|
numfields = numfields - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if (numfields > 0) then
|
||||||
|
local otherfields = subtree:add("Other Fields")
|
||||||
|
for i = 1,numfields do
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
range = range(0, range:strsize())
|
||||||
|
otherfields:add(range)
|
||||||
|
numfields = numfields - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
range = buffer(range:offset()+range:len())
|
||||||
|
if (range:len() > 0) then
|
||||||
|
subtree:add(zephyr_protocol.fields.z_message_len, range:len())
|
||||||
|
subtree:add(zephyr_protocol.fields.z_message, range)
|
||||||
|
end
|
||||||
|
local info = kind_names[kind] .. " " .. class .. " " .. instance .. " " .. opcode
|
||||||
|
pinfo.columns.info = info
|
||||||
|
subtree.text = "Zephyr, " .. info
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local udp_port = DissectorTable.get("udp.port")
|
||||||
|
udp_port:add(2102, zephyr_protocol)
|
||||||
|
udp_port:add(2103, zephyr_protocol)
|
||||||
|
udp_port:add(2104, zephyr_protocol)
|
1
debian/.gitattributes
vendored
Normal file
1
debian/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
zephyr.vars ident
|
1
debian/README.krb4-5
vendored
Normal file
1
debian/README.krb4-5
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
Placehold that will explain how to build an agile server goes here.
|
9
debian/acl/class-registry.acl
vendored
Normal file
9
debian/acl/class-registry.acl
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
wg_ctl:
|
||||||
|
hm_ctl:
|
||||||
|
hm_stat:
|
||||||
|
locate:
|
||||||
|
login:
|
||||||
|
zephyr_admin:
|
||||||
|
zephyr_ctl:
|
||||||
|
zmatch_all:
|
||||||
|
operations:
|
1
debian/acl/iui-hm_ctl.acl
vendored
Normal file
1
debian/acl/iui-hm_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-hm_stat.acl
vendored
Normal file
1
debian/acl/iui-hm_stat.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-login.acl
vendored
Normal file
1
debian/acl/iui-login.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-operations.acl
vendored
Normal file
1
debian/acl/iui-operations.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/iui-user_locate.acl
vendored
Normal file
1
debian/acl/iui-user_locate.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-wg_ctl.acl
vendored
Normal file
1
debian/acl/iui-wg_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-zephyr_admin.acl
vendored
Normal file
1
debian/acl/iui-zephyr_admin.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iui-zephyr_ctl.acl
vendored
Normal file
1
debian/acl/iui-zephyr_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-hm_ctl.acl
vendored
Normal file
1
debian/acl/iws-hm_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-hm_stat.acl
vendored
Normal file
1
debian/acl/iws-hm_stat.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-login.acl
vendored
Normal file
1
debian/acl/iws-login.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-operations.acl
vendored
Normal file
1
debian/acl/iws-operations.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/iws-user_locate.acl
vendored
Normal file
1
debian/acl/iws-user_locate.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-wg_ctl.acl
vendored
Normal file
1
debian/acl/iws-wg_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-zephyr_admin.acl
vendored
Normal file
1
debian/acl/iws-zephyr_admin.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/iws-zephyr_ctl.acl
vendored
Normal file
1
debian/acl/iws-zephyr_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/sub-hm_ctl.acl
vendored
Normal file
1
debian/acl/sub-hm_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/sub-hm_stat.acl
vendored
Normal file
1
debian/acl/sub-hm_stat.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/sub-login.acl
vendored
Normal file
1
debian/acl/sub-login.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/sub-operations.acl
vendored
Normal file
1
debian/acl/sub-operations.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/sub-user_locate.acl
vendored
Normal file
1
debian/acl/sub-user_locate.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/sub-wg_ctl.acl
vendored
Normal file
1
debian/acl/sub-wg_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/sub-zephyr_admin.acl
vendored
Normal file
1
debian/acl/sub-zephyr_admin.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/sub-zephyr_ctl.acl
vendored
Normal file
1
debian/acl/sub-zephyr_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-hm_ctl.acl
vendored
Normal file
1
debian/acl/xmt-hm_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-hm_stat.acl
vendored
Normal file
1
debian/acl/xmt-hm_stat.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-login.acl
vendored
Normal file
1
debian/acl/xmt-login.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/xmt-operations.acl
vendored
Normal file
1
debian/acl/xmt-operations.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-user_locate.acl
vendored
Normal file
1
debian/acl/xmt-user_locate.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
1
debian/acl/xmt-wg_ctl.acl
vendored
Normal file
1
debian/acl/xmt-wg_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-zephyr_admin.acl
vendored
Normal file
1
debian/acl/xmt-zephyr_admin.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
debian/acl/xmt-zephyr_ctl.acl
vendored
Normal file
1
debian/acl/xmt-zephyr_ctl.acl
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.*@*
|
89
debian/changelog
vendored
Normal file
89
debian/changelog
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
zephyr (1:3.1.999-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* The next actual release on this branch will be 3.2... someday
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Mon, 28 Oct 2013 00:32:21 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1.1-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1.1
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Fri, 25 Oct 2013 01:15:29 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sat, 12 Oct 2013 13:15:58 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1~rc2-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1~rc2
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sun, 06 Oct 2013 20:53:42 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1~rc1-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1~rc1
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sat, 28 Sep 2013 19:45:21 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1~rc0-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1~rc0
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sat, 28 Sep 2013 15:18:25 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1~beta1-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1~beta1
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Thu, 08 Aug 2013 02:23:32 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.1-beta0-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.1-beta0
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sun, 07 Jul 2013 22:08:01 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.0.999-trunk) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* Any further revisions to 3.0.x go on the 3.0.x branch; the mainline is for 3.1 stuff
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sat, 11 Feb 2012 10:53:49 -0500
|
||||||
|
|
||||||
|
zephyr (1:3.0.2-trunk) unstable; urgency=low
|
||||||
|
|
||||||
|
* release 3.0.2
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sun, 22 Jan 2012 02:12:41 -0500
|
||||||
|
|
||||||
|
zephyr (1:3.0.1) unstable; urgency=low
|
||||||
|
|
||||||
|
* 80% more nelhage proof
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sun, 06 Mar 2011 10:54:46 -0500
|
||||||
|
|
||||||
|
zephyr (1:3.0.1~rc.HEAD) unstable; urgency=low
|
||||||
|
|
||||||
|
* bugfixes ahoy.
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Wed, 07 Jul 2010 16:26:49 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.0) unstable; urgency=low
|
||||||
|
|
||||||
|
* Might as well let it escape.
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Mon, 05 Oct 2009 19:56:17 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.0~rc.HEAD) unstable; urgency=low
|
||||||
|
|
||||||
|
* It's Release Candidate Time!
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Mon, 03 Aug 2009 01:27:46 -0400
|
||||||
|
|
||||||
|
zephyr (1:3.0~beta.HEAD) inconceivable; urgency=low
|
||||||
|
|
||||||
|
* Mark version for upstream trunk
|
||||||
|
|
||||||
|
-- Karl Ramm <kcr@1ts.org> Sat, 28 Mar 2009 12:59:14 -0400
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
5
|
191
debian/control
vendored
Normal file
191
debian/control
vendored
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
Source: zephyr
|
||||||
|
Section: net
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Karl Ramm <kcr@1ts.org>
|
||||||
|
Build-Depends: debhelper (>= 5), libc-ares-dev, libkrb5-dev (>= 1.2.2-4),
|
||||||
|
comerr-dev, ss-dev, libreadline-dev | libreadline5-dev,
|
||||||
|
libx11-dev, libxt-dev, x11proto-core-dev, libncurses5-dev,
|
||||||
|
bison, libhesiod-dev, autotools-dev, python (>= 2.5), python-central,
|
||||||
|
autoconf, libtool, automake, git-core | git, devscripts
|
||||||
|
Build-Conflicts: autoconf2.13
|
||||||
|
Standards-Version: 3.9.2.0
|
||||||
|
Homepage: http://zephyr.1ts.org/
|
||||||
|
Vcs-Svn: git://zephyr.1ts.org/zephyr.git
|
||||||
|
Vcs-Browser: http://zephyr.1ts.org/browser/zephyr
|
||||||
|
XS-Python-Version: 2.5
|
||||||
|
|
||||||
|
Package: libzephyr4
|
||||||
|
Section: libs
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Conflicts: libzephyr4-krb, libzephyr4-krb5, libzephyr4-krb45
|
||||||
|
Description: Project Athena's notification service - non-Kerberos libraries
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides the libraries without Kerberos support.
|
||||||
|
|
||||||
|
Package: libzephyr4-krb
|
||||||
|
Section: libs
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, krb4-config
|
||||||
|
Conflicts: libzephyr4, libzephyr4-krb5, libzephyr4-krb45
|
||||||
|
Replaces: libzephyr4, libzephyr4-krb5, libzephyr4-krb45
|
||||||
|
Provides: libzephyr4
|
||||||
|
Description: Project Athena's notification service - libraries with Kerberos
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides libraries that use Kerberos.
|
||||||
|
|
||||||
|
Package: libzephyr4-krb5
|
||||||
|
Section: libs
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, krb5-config
|
||||||
|
Conflicts: libzephyr4, libzephyr4-krb, libzephyr4-krb45
|
||||||
|
Replaces: libzephyr4, libzephyr4-krb, libzephyr4-krb45
|
||||||
|
Provides: libzephyr4
|
||||||
|
Description: The original "Instant Message" system libraries with Kerberos 5
|
||||||
|
This version of the library uses Kerberos for message authentication.
|
||||||
|
.
|
||||||
|
This is the Project Athena Zephyr notification system.
|
||||||
|
Zephyr allows users to send messages to other users or to groups of
|
||||||
|
users. Users can view incoming Zephyr messages as windowgrams
|
||||||
|
(transient X windows) or as text on a terminal.
|
||||||
|
|
||||||
|
Package: libzephyr4-krb45
|
||||||
|
Section: libs
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, krb5-config
|
||||||
|
Conflicts: libzephyr4, libzephyr4-krb, libzephyr4-krb5
|
||||||
|
Replaces: libzephyr4, libzephyr4-krb, libzephyr4-krb5
|
||||||
|
Provides: libzephyr4
|
||||||
|
Description: The original "Instant Message" system libraries with Kerberos 4+5
|
||||||
|
This version of the library uses Kerberos for message authentication.
|
||||||
|
.
|
||||||
|
This is the Project Athena Zephyr notification system.
|
||||||
|
Zephyr allows users to send messages to other users or to groups of
|
||||||
|
users. Users can view incoming Zephyr messages as windowgrams
|
||||||
|
(transient X windows) or as text on a terminal.
|
||||||
|
|
||||||
|
Package: libzephyr-python
|
||||||
|
Section: python
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${python:Depends}, ${misc:Depends}, libzephyr4
|
||||||
|
Provides: ${python:Provides}
|
||||||
|
XB-Python-Version: ${python:Verions}
|
||||||
|
Description: Python bindings for zephyr library
|
||||||
|
Get at the zephyr library from python.
|
||||||
|
|
||||||
|
Package: zephyr-clients
|
||||||
|
Section: net
|
||||||
|
Replaces: zephyr-client
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, debianutils (>= 1.6), debconf | debconf-2.0
|
||||||
|
Description: Project Athena's notification service - client programs
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides client programs for the messaging service.
|
||||||
|
|
||||||
|
Package: zephyr-server
|
||||||
|
Section: net
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0
|
||||||
|
Conflicts: zephyr-server-krb, zephyr-server-krb5, zephyr-server-krb45
|
||||||
|
Description: Project Athena's notification service - non-Kerberos server
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides the server for the messaging service, which
|
||||||
|
maintains a location and subscription database for all the receiving
|
||||||
|
clients. All zephyrgrams are sent to the server to be routed to the
|
||||||
|
intended recipient. Only one server is required for a group of clients.
|
||||||
|
|
||||||
|
Package: zephyr-server-krb
|
||||||
|
Section: net
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0, libzephyr4-krb
|
||||||
|
Conflicts: zephyr-server, zephyr-server-krb5, zephyr-server-krb45
|
||||||
|
Replaces: zephyr-server, zephyr-server-krb5, zephyr-server-krb45
|
||||||
|
Provides: zephyr-server
|
||||||
|
Description: Project Athena's notification service - server with Kerberos
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides the server for the messaging service. Only one
|
||||||
|
server is needed for a group of client. The program consumes much memory,
|
||||||
|
especially for very large sites.
|
||||||
|
.
|
||||||
|
The server maintains a location and subscription database for all the
|
||||||
|
receiving clients. All zephyrgrams are sent to the server to be routed
|
||||||
|
to the intended recipient.
|
||||||
|
.
|
||||||
|
This version of the server uses Kerberos.
|
||||||
|
|
||||||
|
Package: zephyr-server-krb5
|
||||||
|
Section: net
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0, libzephyr4-krb5
|
||||||
|
Conflicts: zephyr-server, zephyr-server-krb, zephyr-server-krb45
|
||||||
|
Replaces: zephyr-server, zephyr-server-krb, zephyr-server-krb45
|
||||||
|
Provides: zephyr-server
|
||||||
|
Description: The original "Instant Message" system-server with Kerberos 5
|
||||||
|
You probably only need one server for a group of clients.
|
||||||
|
This can be a memory-intensive server, especially for very large sites.
|
||||||
|
.
|
||||||
|
The server maintains a location and subscription database for all the
|
||||||
|
receiving clients. All zephyrgrams are sent to the server to be routed
|
||||||
|
to the intended recipient.
|
||||||
|
.
|
||||||
|
This version of the server uses Kerberos for message authentication.
|
||||||
|
.
|
||||||
|
This is the Project Athena Zephyr notification system.
|
||||||
|
Zephyr allows users to send messages to other users or to groups of
|
||||||
|
users. Users can view incoming Zephyr messages as windowgrams
|
||||||
|
(transient X windows) or as text on a terminal.
|
||||||
|
|
||||||
|
Package: zephyr-server-krb45
|
||||||
|
Section: net
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0, libzephyr4-krb45
|
||||||
|
Conflicts: zephyr-server, zephyr-server-krb, zephyr-server-krb5
|
||||||
|
Replaces: zephyr-server, zephyr-server-krb, zephyr-server-krb5
|
||||||
|
Provides: zephyr-server
|
||||||
|
Description: The original "Instant Message" system-server with Kerberos 4+5
|
||||||
|
You probably only need one server for a group of clients.
|
||||||
|
This can be a memory-intensive server, especially for very large sites.
|
||||||
|
.
|
||||||
|
The server maintains a location and subscription database for all the
|
||||||
|
receiving clients. All zephyrgrams are sent to the server to be routed
|
||||||
|
to the intended recipient.
|
||||||
|
.
|
||||||
|
This version of the server uses Kerberos for message authentication.
|
||||||
|
.
|
||||||
|
This is the Project Athena Zephyr notification system.
|
||||||
|
Zephyr allows users to send messages to other users or to groups of
|
||||||
|
users. Users can view incoming Zephyr messages as windowgrams
|
||||||
|
(transient X windows) or as text on a terminal.
|
||||||
|
|
||||||
|
Package: libzephyr-dev
|
||||||
|
Section: libdevel
|
||||||
|
Architecture: any
|
||||||
|
Depends: libzephyr4 (= ${binary:Version}) | libzephyr4-krb (= ${binary:Version}) | libzephyr4-krb5 (= ${binary:Version}) | libzephyr4-krb45 (= ${binary:Version}), ${misc:Depends}, libc6-dev
|
||||||
|
Description: Project Athena's notification service - development files
|
||||||
|
Zephyr is derived from the original Project Athena 'Instant Message' system
|
||||||
|
and allows users to send messages to other users or to groups of users.
|
||||||
|
Users can view incoming Zephyr messages as windowgrams (transient X
|
||||||
|
windows) or as text on a terminal.
|
||||||
|
.
|
||||||
|
This package provides development libraries and files, which are
|
||||||
|
needed to compile alternative Zephyr clients.
|
125
debian/copyright
vendored
Normal file
125
debian/copyright
vendored
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
This package was debianized by Karl Ramm <kcr@1ts.org> on
|
||||||
|
Mon, 4 Dec 2000 05:28:22 -0500.
|
||||||
|
|
||||||
|
It was downloaded from ftp://athena-dist.mit.edu/pub/ATHENA/zephyr
|
||||||
|
|
||||||
|
Copyright:
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Copyright 1987,1988,1995 by the Massachusetts Institute of Technology
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
|
documentation for any purpose and without fee is hereby granted,
|
||||||
|
provided that the above copyright notice appear in all copies and that
|
||||||
|
both that copyright notice and this permission notice appear in
|
||||||
|
supporting documentation, and that the name of the Massachusetts
|
||||||
|
Institute of Technology (M.I.T.) not be used in advertising or publicity
|
||||||
|
pertaining to distribution of the software without specific, written
|
||||||
|
prior permission.
|
||||||
|
|
||||||
|
M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||||
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||||
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* lib/quad_cksum.c
|
||||||
|
*
|
||||||
|
* Copyright 1985, 1986, 1987, 1988,1990 by the Massachusetts Institute
|
||||||
|
* of Technology.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Export of this software from the United States of America may
|
||||||
|
* require a specific license from the United States Government.
|
||||||
|
* It is the responsibility of any person or organization contemplating
|
||||||
|
* export to obtain such a license before exporting.
|
||||||
|
*
|
||||||
|
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
||||||
|
* distribute this software and its documentation for any purpose and
|
||||||
|
* without fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright notice and
|
||||||
|
* this permission notice appear in supporting documentation, and that
|
||||||
|
* the name of M.I.T. not be used in advertising or publicity pertaining
|
||||||
|
* to distribution of the software without specific, written prior
|
||||||
|
* permission. Furthermore if you modify this software you must label
|
||||||
|
* your software as modified software and not distribute it in such a
|
||||||
|
* fashion that it might be confused with the original M.I.T. software.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is" without express
|
||||||
|
* or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
server/utf8proc.[ch]:
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2007 Jan Behrens, FlexiGuided GmbH, Berlin
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
server/utf8proc_data.c:
|
||||||
|
/*
|
||||||
|
* This file contains derived data from a modified version of the
|
||||||
|
* Unicode data files.
|
||||||
|
*
|
||||||
|
* The original data files are available at
|
||||||
|
* http://www.unicode.org/Public/UNIDATA/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* COPYRIGHT AND PERMISSION NOTICE
|
||||||
|
*
|
||||||
|
* Copyright (c) 1991-2007 Unicode, Inc. All rights reserved. Distributed
|
||||||
|
* under the Terms of Use in http://www.unicode.org/copyright.html.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of the Unicode data files and any associated documentation (the "Data
|
||||||
|
* Files") or Unicode software and any associated documentation (the
|
||||||
|
* "Software") to deal in the Data Files or Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge,
|
||||||
|
* publish, distribute, and/or sell copies of the Data Files or Software, and
|
||||||
|
* to permit persons to whom the Data Files or Software are furnished to do
|
||||||
|
* so, provided that (a) the above copyright notice(s) and this permission
|
||||||
|
* notice appear with all copies of the Data Files or Software, (b) both the
|
||||||
|
* above copyright notice(s) and this permission notice appear in associated
|
||||||
|
* documentation, and (c) there is clear notice in each modified Data File or
|
||||||
|
* in the Software as well as in the documentation associated with the Data
|
||||||
|
* File(s) or Software that the data or software has been modified.
|
||||||
|
*
|
||||||
|
* THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||||
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
|
||||||
|
* CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||||
|
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
||||||
|
*
|
||||||
|
* Except as contained in this notice, the name of a copyright holder shall
|
||||||
|
* not be used in advertising or otherwise to promote the sale, use or other
|
||||||
|
* dealings in these Data Files or Software without prior written
|
||||||
|
* authorization of the copyright holder.
|
||||||
|
*/
|
||||||
|
|
3
debian/default.subscriptions
vendored
Normal file
3
debian/default.subscriptions
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
operations,message,*
|
||||||
|
message,personal,%me%
|
||||||
|
message,urgent,%me%
|
2
debian/dirs
vendored
Normal file
2
debian/dirs
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
usr/bin
|
||||||
|
usr/sbin
|
6
debian/libzephyr-dev.files
vendored
Normal file
6
debian/libzephyr-dev.files
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
usr/lib/libzephyr.a
|
||||||
|
usr/lib/libzephyr.so
|
||||||
|
usr/lib/pkgconfig/zephyr.pc
|
||||||
|
usr/include/zephyr/mit-copyright.h
|
||||||
|
usr/include/zephyr/zephyr.h
|
||||||
|
usr/include/zephyr/zephyr_err.h
|
1
debian/libzephyr-python.files
vendored
Normal file
1
debian/libzephyr-python.files
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
usr/lib/python2.5/site-packages/zephyr_ctypes.py
|
15
debian/libzephyr4-krb5.templates
vendored
Normal file
15
debian/libzephyr4-krb5.templates
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Template: libzephyr4-krb5/no-more-krb4
|
||||||
|
Type: boolean
|
||||||
|
Default: true
|
||||||
|
Description: Potentially incompatible upgrade
|
||||||
|
You appear to be upgrading from a version of zephyr that uses
|
||||||
|
Kerberos version 4 to authenticate. Kerberos version 4 support has
|
||||||
|
been removed from Debian, and accordingly from zephyr. This version
|
||||||
|
of zephyr uses Kerberos 5 to authenticate, and thus your servers must
|
||||||
|
have been upgraded for it to be useful.
|
||||||
|
.
|
||||||
|
A server that authenticates both ways can be built for lenny from the
|
||||||
|
zephyr source package, see:
|
||||||
|
/usr/share/doc/libzephyr4-krb5/README.krb4-5
|
||||||
|
.
|
||||||
|
Continue with the upgrade?
|
1
debian/libzephyr4.files
vendored
Normal file
1
debian/libzephyr4.files
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
usr/lib/libzephyr.so.*
|
2
debian/po/POTFILES.in
vendored
Normal file
2
debian/po/POTFILES.in
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[type: gettext/rfc822deb] zephyr-clients.templates
|
||||||
|
[type: gettext/rfc822deb] zephyr-server.templates
|
91
debian/po/cs.po
vendored
Normal file
91
debian/po/cs.po
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
#
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
#
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-08 17:00+0100\n"
|
||||||
|
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
|
||||||
|
"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Zephyr servery:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Zadejte prosím plná jména Zephyr serverů; jednotlivá jména oddělte mezerami."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"Seznam definovaný na klientech může být podmnožinou seznamu definovaného na "
|
||||||
|
"serverech."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Pokud pro oznamování Zephyr serverů používáte Hesiod, můžete ponechat "
|
||||||
|
"prázdné."
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "We want to try and capture user changes when they edit a config file "
|
||||||
|
#~ "manually. To do this we look at the file in the config script. However, "
|
||||||
|
#~ "in the case of preconfigure, the config script is run twice before the "
|
||||||
|
#~ "postinst is run. Thus we may read the wrong value before the edited "
|
||||||
|
#~ "value is written out in postinst. If this is false we skip reading config "
|
||||||
|
#~ "files until postinst runs."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Snažíme se rozpoznat a zachytit uživatelovy ruční změny v konfiguračním "
|
||||||
|
#~ "souboru, což se děje v konfiguračním skriptu. Ovšem v případě "
|
||||||
|
#~ "předkonfigurace je konfigurační skript spuštěn dvakrát před spuštěním "
|
||||||
|
#~ "poinstalačního skriptu a tudíž můžeme přečíst chybnou hodnotu před tím, "
|
||||||
|
#~ "než je upravená hodnota zapsána v poinstalačním kroku. Pokud je to "
|
||||||
|
#~ "chybně, přeskočíme čtení kofiguračních souborů až do poinstalační fáze."
|
||||||
|
|
||||||
|
#~ msgid "You have no zephyr servers specified for the client"
|
||||||
|
#~ msgstr "Pro klienta jste nezadali žádné zephyr servery"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "The zephyr-clients package for whatever reason does not have any zephyr "
|
||||||
|
#~ "servers configured. Please edit the file /etc/default/zephyr-clients and "
|
||||||
|
#~ "add the names of your zephyr servers, separated by spaces to the zhm_args "
|
||||||
|
#~ "variable."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Balíček zephyr-clients nemá z nějakého důvodu nakonfigurován žádný zephyr "
|
||||||
|
#~ "server. Upravte prosím soubor /etc/default/zephyr-clients a přidejte do "
|
||||||
|
#~ "něj do proměnné zhm_args mezerami oddělená jména zephyr serverů."
|
||||||
|
|
||||||
|
#~ msgid "What are your zephyr servers?"
|
||||||
|
#~ msgstr "Jaké jsou vaše zephyr servery?"
|
||||||
|
|
||||||
|
#~ msgid "You should never see this"
|
||||||
|
#~ msgstr "Toto jste nikdy neměli vidět"
|
65
debian/po/es.po
vendored
Normal file
65
debian/po/es.po
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# zephyr debconf translation to spanish
|
||||||
|
# Copyright (C) 2001, 2006, 2007 Software in the Public Interest
|
||||||
|
# This file is distributed under the same license as the zephyr package.
|
||||||
|
#
|
||||||
|
# Changes:
|
||||||
|
# - Initial translation
|
||||||
|
# Carlos Valdivia Yagüe <valyag@dat.etsit.upm.es>, 2001, 2006, 2007
|
||||||
|
#
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
#
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
#
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr 2.1.20070719.SNAPSHOT-4\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-05 15:50+0100\n"
|
||||||
|
"Last-Translator: Carlos Valdivia Yagüe <valyag@dat.etsit.upm.es>\n"
|
||||||
|
"Language-Team: Debian L10n Spanish <debian-l10n-spanish@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Servidores Zephyr:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Por favor, introduzca el nombre completo de los servidores Zephyr como una "
|
||||||
|
"lista separada por espacios."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"La lista configurada en los clientes puede ser un subconjunto de la lista "
|
||||||
|
"configurada en los servidores."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Puede dejarlo en blanco si se utiliza Hesiod para anunciar los servidores "
|
||||||
|
"Zephyr."
|
56
debian/po/fr.po
vendored
Normal file
56
debian/po/fr.po
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# translation of fr.po to French
|
||||||
|
#
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr_2.1.20070913.SNAPSHOT-3\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-23 15:01+0100\n"
|
||||||
|
"Last-Translator: Michel Grentzinger <mic.grentz@online.fr>\n"
|
||||||
|
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=ISO-8859-15\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Serveurs Zephyr :"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Veuillez indiquer le nom complet des serveurs Zephyr, séparés par un espace."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"La liste configurée sur les clients peut être un sous-ensemble de la liste "
|
||||||
|
"configurée sur les serveurs."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Ce champ peut être laissé vide si Hesiod est employé pour annoncer les "
|
||||||
|
"serveurs Zephyr."
|
100
debian/po/gl.po
vendored
Normal file
100
debian/po/gl.po
vendored
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
# Galician translation of zephyr's debconf templates
|
||||||
|
# This file is distributed under the same license as the zephyr package.
|
||||||
|
# Jacobo Tarrio <jtarrio@debian.org>, 2007.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-05 20:45+0000\n"
|
||||||
|
"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
|
||||||
|
"Language-Team: Galician <proxecto@trasno.net>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Servidores zephyr:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Indique os nomes completos dos servidores Zephyr, nunha lista de nomes "
|
||||||
|
"separados por comas."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"A lista configurada nos clientes pode ser un subconxunto da lista "
|
||||||
|
"configurada nos servidores."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Pódese deixar baleiro se se emprega Hesiod para anunciar os servidores "
|
||||||
|
"Zephyr."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(note that this can be a subset of what you're telling the servers) If "
|
||||||
|
#~ "you are using hesiod to advertise your zephyr servers, leave this blank."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Escriba os nomes completos dos seus servidores zephyr, separados por "
|
||||||
|
#~ "espazos. (Teña en conta que isto pode ser un subconxunto do que lles "
|
||||||
|
#~ "conta aos servidores)"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(Note that this can be a superset of that you're telling the clients.)"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Escriba os nomes completos dos seus servidores zephyr, separados por "
|
||||||
|
#~ "espazos. (Teña en conta que pode ser un superconxunto do que lles di aos "
|
||||||
|
#~ "clientes)."
|
||||||
|
|
||||||
|
#~ msgid "for internal use"
|
||||||
|
#~ msgstr "para uso interno"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "We want to try and capture user changes when they edit a config file "
|
||||||
|
#~ "manually. To do this we look at the file in the config script. However, "
|
||||||
|
#~ "in the case of preconfigure, the config script is run twice before the "
|
||||||
|
#~ "postinst is run. Thus we may read the wrong value before the edited "
|
||||||
|
#~ "value is written out in postinst. If this is false we skip reading config "
|
||||||
|
#~ "files until postinst runs."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Preténdes capturar os cambios que fan os usuarios cando modifican "
|
||||||
|
#~ "manualmente un ficheiro de configuración. Para facelo consúltase o "
|
||||||
|
#~ "ficheiro no script de configuración. Nembargantes, no caso da "
|
||||||
|
#~ "preconfiguración, o script de configuración execútase dúas veces antes de "
|
||||||
|
#~ "executar o script de post-instalación. Polo tanto, pódese ler o valor "
|
||||||
|
#~ "incorrecto antes de que se grave o valor editado na post-instalación. Se "
|
||||||
|
#~ "isto é falso omítese a lectura de ficheiros de configuración ata que se "
|
||||||
|
#~ "execute o script de post-instalación."
|
||||||
|
|
||||||
|
#~ msgid "You have no zephyr servers specified for the client"
|
||||||
|
#~ msgstr "Non especificou servidores zephyr para o cliente"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "The zephyr-clients package for whatever reason does not have any zephyr "
|
||||||
|
#~ "servers configured. Please edit the file /etc/default/zephyr-clients and "
|
||||||
|
#~ "add the names of your zephyr servers, separated by spaces to the zhm_args "
|
||||||
|
#~ "variable."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por algún motivo, o paquete zephyr-clients non ten configurado ningún "
|
||||||
|
#~ "servidor zephyr. Edite o ficheiro /etc/default/zephyr-clients e engada os "
|
||||||
|
#~ "nomes dos servidores zephyr, separados por espazos, á variable zhm_args."
|
45
debian/po/ja.po
vendored
Normal file
45
debian/po/ja.po
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright (C) 2008 Karl Ramm <kcr@debian.org>
|
||||||
|
# This file is distributed under the same license as the zephyr package.
|
||||||
|
# Hideki Yamane (Debian-JP) <henrich@debian.or.jp>, 2008.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr 2.1.20070719.SNAPSHOT-1.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2008-12-28 22:26+0900\n"
|
||||||
|
"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n"
|
||||||
|
"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Zephyr サーバ:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Zephyr サーバの名前を全て、スペースで区切ったリストで指定してください。"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"クライアント上で設定されたリストは、サーバ上で設定されたリストのサブセットになります。"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr "Hesiod を Zephyr サーバの広報に利用している場合は、ここは空のままで構いません。"
|
112
debian/po/nl.po
vendored
Normal file
112
debian/po/nl.po
vendored
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
#
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
#
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
#
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-09 14:00+0100\n"
|
||||||
|
"Last-Translator: Bart Cornelis <cobaco@skolelinux.no>\n"
|
||||||
|
"Language-Team: debian-l10n-dutch <debian-l10n-dutch@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: Dutch\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Zephyr-servers:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Gelieve hier een (met spaties gescheiden) lijst van de de volledige namen "
|
||||||
|
"van de Zephyr-servers op te geven."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"De op de clients ingestelde lijst mag een subset zijn van de op de servers "
|
||||||
|
"ingestelde lijst."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Als u Hesiod gebruikt om Zephyr-servers te adverteren kunt u dit veld "
|
||||||
|
"leeglaten."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(note that this can be a subset of what you're telling the servers) If "
|
||||||
|
#~ "you are using hesiod to advertise your zephyr servers, leave this blank."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Gelieve de volledige naam van uw zephyr-servers op te geven gescheiden "
|
||||||
|
#~ "door spaties (merk op dat dit een subset kan zijn van wat u aan de "
|
||||||
|
#~ "servers vertelt)."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(Note that this can be a superset of that you're telling the clients.)"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Gelieve de volledige namen van uw zephyr-servers op te geven, gescheiden "
|
||||||
|
#~ "door spaties (merk op dat dit een superset kan zijn van wat u de clients "
|
||||||
|
#~ "verteld)."
|
||||||
|
|
||||||
|
#~ msgid "for internal use"
|
||||||
|
#~ msgstr "voor intern gebruik"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "We want to try and capture user changes when they edit a config file "
|
||||||
|
#~ "manually. To do this we look at the file in the config script. However, "
|
||||||
|
#~ "in the case of preconfigure, the config script is run twice before the "
|
||||||
|
#~ "postinst is run. Thus we may read the wrong value before the edited "
|
||||||
|
#~ "value is written out in postinst. If this is false we skip reading config "
|
||||||
|
#~ "files until postinst runs."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Er wordt geprobeerd om gebruikersaanpassingen op te vangen wanneer een "
|
||||||
|
#~ "configuratiebestand handmatig aangepast wordt. Hiertoe kijkt het "
|
||||||
|
#~ "'config'-script in het configuratiebestand, maar in het geval van "
|
||||||
|
#~ "preconfigure wordt dit script tweemaal uitgevoerd voordat het 'postinst'-"
|
||||||
|
#~ "script gedraaid wordt. Dit kan er toe leiden dat de verkeerde waarde "
|
||||||
|
#~ "wordt uitgeschreven voordat de aangepaste waarde uitgeschreven wordt in "
|
||||||
|
#~ "het 'postinst'-script. Als dit onwaar is slaan we het lezen van "
|
||||||
|
#~ "configuratiebestanden over totdat het 'postinst'-script uitgevoerd is."
|
||||||
|
|
||||||
|
#~ msgid "You have no zephyr servers specified for the client"
|
||||||
|
#~ msgstr "U heeft geen zephyr-servers opgegeven voor de client."
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "The zephyr-clients package for whatever reason does not have any zephyr "
|
||||||
|
#~ "servers configured. Please edit the file /etc/default/zephyr-clients and "
|
||||||
|
#~ "add the names of your zephyr servers, separated by spaces to the zhm_args "
|
||||||
|
#~ "variable."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Het 'zephyr-clients'-pakket heeft om wat voor reden dan ook geen zephyr-"
|
||||||
|
#~ "servers ingesteld. Gelieve het bestand /etc/default/zephyr-clients aan te "
|
||||||
|
#~ "passen en de namen van uw zephyr-servers gescheiden door spaties toe te "
|
||||||
|
#~ "voegen aan de 'zhm_args'-variabele."
|
98
debian/po/pt.po
vendored
Normal file
98
debian/po/pt.po
vendored
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
# Portuguese translation for zephyr's debconf messages
|
||||||
|
# Ricardo Silva <ardoric@gmail.com>, 2007
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr 2.1.20070719.SNAPSHOT-3\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-19 22:05+0000\n"
|
||||||
|
"Last-Translator: Ricardo Silva <ardoric@gmail.com>\n"
|
||||||
|
"Language-Team: Portuguese <traduz@debianpt.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Servidores Zephyr:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Por favor especifique o nome completo dos servidores Zephyr, numa lista "
|
||||||
|
"separada por espaços."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"A lista configurada nos clientes pode ser um sub-conjunto da lista "
|
||||||
|
"configurada nos servidores."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Esta opção pode ser deixada vazia se o Hesiod for utilizado para anunciar os "
|
||||||
|
"servidores Zephyr."
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(note that this can be a subset of what you're telling the servers) If "
|
||||||
|
#~ "you are using hesiod to advertise your zephyr servers, leave this blank."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por favor escreva os nomes completos dos seus servidores zephyr, "
|
||||||
|
#~ "separados por espaços. (note que esta lista pode ser um subconjunto do "
|
||||||
|
#~ "que diz aos servidores)"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(Note that this can be a superset of that you're telling the clients.)"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por favor escreva os nomes completos dos seus servidores zephyr, "
|
||||||
|
#~ "separados por espaços. (Note que esta lista pode ser um super-conjunto "
|
||||||
|
#~ "do que diz aos clientes.)"
|
||||||
|
|
||||||
|
#~ msgid "for internal use"
|
||||||
|
#~ msgstr "para uso interno"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "We want to try and capture user changes when they edit a config file "
|
||||||
|
#~ "manually. To do this we look at the file in the config script. However, "
|
||||||
|
#~ "in the case of preconfigure, the config script is run twice before the "
|
||||||
|
#~ "postinst is run. Thus we may read the wrong value before the edited "
|
||||||
|
#~ "value is written out in postinst. If this is false we skip reading config "
|
||||||
|
#~ "files until postinst runs."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Tentamos determinar que alterações os utilizadores fazem quando editam "
|
||||||
|
#~ "um ficheiro de configuração manualmente. Para tal analisamos o ficheiro "
|
||||||
|
#~ "no script de configuração. No entanto quando há pré-configuração, o "
|
||||||
|
#~ "script de configuração é corrido duas vezes antes do pós-instalaçÃ"
|
||||||
|
#~ "£o. Assim podemos ler os valores errados antes que o valor editado seja "
|
||||||
|
#~ "escrito no pós-instalação. Se esta opção for falsa não analisamos "
|
||||||
|
#~ "os ficheiros de configuração até que o pós-instalação corra."
|
||||||
|
|
||||||
|
#~ msgid "You have no zephyr servers specified for the client"
|
||||||
|
#~ msgstr "Não tem nenhum servidor zephyr especificado para o cliente"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "The zephyr-clients package for whatever reason does not have any zephyr "
|
||||||
|
#~ "servers configured. Please edit the file /etc/default/zephyr-clients and "
|
||||||
|
#~ "add the names of your zephyr servers, separated by spaces to the zhm_args "
|
||||||
|
#~ "variable."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "O pacote zephyr-clients por alguma razão não tem nenhum servidor zephyr "
|
||||||
|
#~ "configurado. Por favor edite o ficheiro /etc/default/zephyr-clients e "
|
||||||
|
#~ "adicione os nomes dos seus servidores zephyr, separados por espaços à "
|
||||||
|
#~ "variável zhm_args."
|
111
debian/po/pt_BR.po
vendored
Normal file
111
debian/po/pt_BR.po
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr 2.1\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2008-10-06 02:33-0300\n"
|
||||||
|
"Last-Translator: Felipe Augusto van de Wiel (faw) <faw@debian.org>\n"
|
||||||
|
"Language-Team: Brazilian Portuguese <debian-l10n-portuguese@lists.debian."
|
||||||
|
"org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"pt_BR\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Servidores Zephyr:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
"Por favor, especifique os nomes completos dos servidores Zephyr, use uma "
|
||||||
|
"lista separada por espaços."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"A lista configurada nos clientes pode ser um subconjunto da lista "
|
||||||
|
"configurada nos servidores."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"É possível deixar este campo vazio se o Hesiod for usado para anunciar os "
|
||||||
|
"servidores Zephyr."
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(note that this can be a subset of what you're telling the servers) If "
|
||||||
|
#~ "you are using hesiod to advertise your zephyr servers, leave this blank."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por favor digite o nome completo dos seus servidores zephyr, separado por "
|
||||||
|
#~ "espaços. (note que isso pode ser um subconjunto daquilo que você está "
|
||||||
|
#~ "dizendo aos servidores)"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Please type the full names of your zephyr servers, separated by spaces. "
|
||||||
|
#~ "(Note that this can be a superset of that you're telling the clients.)"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por favor digite os nomes completos de seus servidores zephyr, separado "
|
||||||
|
#~ "por espaços. (Note que isso pode ser um subconjunto daquilo que você está "
|
||||||
|
#~ "dizendo aos clientes.)"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "We want to try and capture user changes when they edit a config file "
|
||||||
|
#~ "manually. To do this we look at the file in the config script. However, "
|
||||||
|
#~ "in the case of preconfigure, the config script is run twice before the "
|
||||||
|
#~ "postinst is run. Thus we may read the wrong value before the edited "
|
||||||
|
#~ "value is written out in postinst. If this is false we skip reading config "
|
||||||
|
#~ "files until postinst runs."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Nós queremos tentar e capturar mudanças de usuários quando eles editam um "
|
||||||
|
#~ "arquivo de configuração manualmente. Para fazer isso nós olhamos no "
|
||||||
|
#~ "arquivo do script de configuração. De qualquer forma, no caso de pré-"
|
||||||
|
#~ "configuração, o script de configuração é executado duas vezes antes do "
|
||||||
|
#~ "\"postinst\" ser executado. Se isso for falso nós continuamos lendo os "
|
||||||
|
#~ "arquivos de configuração até que o \"postinst\" seja executado."
|
||||||
|
|
||||||
|
#~ msgid "You have no zephyr servers specified for the client"
|
||||||
|
#~ msgstr "Você não tem servidores zephyr especificados para o cliente"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "The zephyr-clients package for whatever reason does not have any zephyr "
|
||||||
|
#~ "servers configured. Please edit the file /etc/default/zephyr-clients and "
|
||||||
|
#~ "add the names of your zephyr servers, separated by spaces to the zhm_args "
|
||||||
|
#~ "variable."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Por uma razão qualquer o pacote zephyr-clients não possui qualquer "
|
||||||
|
#~ "servidor zephyr configurado. Por favor edite o arquivo /etc/default/"
|
||||||
|
#~ "zephyr-clients e adicione os nomes dos seus servidores zephyr, separado "
|
||||||
|
#~ "por espaços na variável zhm_args."
|
||||||
|
|
||||||
|
#~ msgid "What are your zephyr servers?"
|
||||||
|
#~ msgstr "Quais são os seus servidores zephyr?"
|
||||||
|
|
||||||
|
#~ msgid "You should never see this"
|
||||||
|
#~ msgstr "Você nunca deveria ter visto isso"
|
61
debian/po/ru.po
vendored
Normal file
61
debian/po/ru.po
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# translation of ru.po to Russian
|
||||||
|
#
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
#
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
#
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
# Unknown, 2003,.
|
||||||
|
# Yuri Kozlov <kozlov.y@gmail.com>, 2006, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 2.1.20070719.SNAPSHOT-3\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2007-12-19 20:35+0300\n"
|
||||||
|
"Last-Translator: Yuri Kozlov <kozlov.y@gmail.com>\n"
|
||||||
|
"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
|
||||||
|
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Серверы Zephyr:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr "Введите список полных имён серверов Zephyr через пробел."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"На клиентах можно указывать подмножество списка, настроенного на серверах."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Можно ничего не вводить, если для объявления серверов Zephyr используется "
|
||||||
|
"Hesiod."
|
57
debian/po/sv.po
vendored
Normal file
57
debian/po/sv.po
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# translation of zephyr_2.1.20070719.SNAPSHOT-1.1_sv.po to Swedish
|
||||||
|
# Translators, if you are not familiar with the PO format, gettext
|
||||||
|
# documentation is worth reading, especially sections dedicated to
|
||||||
|
# this format, e.g. by running:
|
||||||
|
# info -n '(gettext)PO Files'
|
||||||
|
# info -n '(gettext)Header Entry'
|
||||||
|
# Some information specific to po-debconf are available at
|
||||||
|
# /usr/share/doc/po-debconf/README-trans
|
||||||
|
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||||
|
# Developers do not need to manually edit POT or PO files.
|
||||||
|
#
|
||||||
|
# Martin Ågren <martin.agren@gmail.com>, 2008.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: zephyr_2.1.20070719.SNAPSHOT-1.1_sv\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: 2008-07-20 10:41+0200\n"
|
||||||
|
"Last-Translator: Martin Ågren <martin.agren@gmail.com>\n"
|
||||||
|
"Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr "Zephyr-servrar:"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr "Ange hela namnen på Zephyr-servrarna som en blankstegsseparerad lista."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
"Den lista som konfigureras på klienter kan vara en delmängd av listan som "
|
||||||
|
"konfigureras på servrar."
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
||||||
|
"Detta fält kan lämnas tomt om Hesiod används för att tillkännage Zephyr-"
|
||||||
|
"servrar."
|
45
debian/po/templates.pot
vendored
Normal file
45
debian/po/templates.pot
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: Source: zephyr@packages.debian.org\n"
|
||||||
|
"POT-Creation-Date: 2007-12-05 09:47+0530\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid "Zephyr servers:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"Please specify the full names of the Zephyr servers, as a space-separated "
|
||||||
|
"list."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001 ../zephyr-server.templates:2001
|
||||||
|
msgid ""
|
||||||
|
"The list configured on clients can be a subset of the list configured on "
|
||||||
|
"servers."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. Type: string
|
||||||
|
#. Description
|
||||||
|
#: ../zephyr-clients.templates:2001
|
||||||
|
msgid "This can be left empty if Hesiod is used to advertise Zephyr servers."
|
||||||
|
msgstr ""
|
177
debian/rules
vendored
Executable file
177
debian/rules
vendored
Executable file
@ -0,0 +1,177 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# Sample debian/rules that uses debhelper.
|
||||||
|
# GNU copyright 1997 by Joey Hess.
|
||||||
|
#
|
||||||
|
# This version is for a hypothetical package that builds an
|
||||||
|
# architecture-dependant package, as well as an architecture-independent
|
||||||
|
# package.
|
||||||
|
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
VARIETALS=krb5
|
||||||
|
#VARIETALS=krb krb45 krb5
|
||||||
|
|
||||||
|
PACKAGES:=-plibzephyr4 -pzephyr-clients -pzephyr-server -plibzephyr-dev -plibzephyr-python $(foreach i,$(VARIETALS),-plibzephyr4-$(i) -pzephyr-server-$(i))
|
||||||
|
|
||||||
|
# This has to be exported to make some magic below work.
|
||||||
|
export DH_OPTIONS
|
||||||
|
CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man \
|
||||||
|
--infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc \
|
||||||
|
--with-cares=/usr --with-hesiod=/usr --enable-cmu-zwgcplus
|
||||||
|
CONFIGURE_krb5=--with-krb5=/usr
|
||||||
|
CONFIGURE_krb45=--with-krb4=/usr --with-krb5=/usr
|
||||||
|
CONFIGURE_krb=--with-krb4=/usr
|
||||||
|
CONFIGURE_no-krb=
|
||||||
|
CFLAGS=-g -O
|
||||||
|
CHECK=
|
||||||
|
|
||||||
|
# see /usr/share/doc/autotools-dev/README.Debian.gz
|
||||||
|
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||||
|
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||||
|
|
||||||
|
# FOR AUTOCONF 2.52 AND NEWER ONLY
|
||||||
|
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
|
||||||
|
CONFIGURE_ROOT += --build $(DEB_HOST_GNU_TYPE)
|
||||||
|
else
|
||||||
|
CONFIGURE_ROOT += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
BUILD_VARIETALS=$(VARIETALS) no-krb
|
||||||
|
|
||||||
|
configure: configure-stamp
|
||||||
|
configure-stamp:
|
||||||
|
dh_testdir
|
||||||
|
# Add here commands to configure the package.
|
||||||
|
libtoolize
|
||||||
|
aclocal
|
||||||
|
automake -a || true # we only want this for install-sh
|
||||||
|
autoreconf
|
||||||
|
mkdir -p $(BUILD_VARIETALS)
|
||||||
|
$(foreach VARIETY,$(BUILD_VARIETALS),(cd $(VARIETY) && CFLAGS="$(CFLAGS)" ../configure $(CONFIGURE_$(VARIETY)) $(CONFIGURE_ROOT));)
|
||||||
|
touch configure-stamp
|
||||||
|
|
||||||
|
build-arch: build-stamp
|
||||||
|
build-indep: build-stamp
|
||||||
|
build: build-stamp
|
||||||
|
build-stamp: configure-stamp
|
||||||
|
dh_testdir
|
||||||
|
|
||||||
|
# Add here commands to compile the package.
|
||||||
|
set -e; \
|
||||||
|
for dir in $(VARIETALS) ; do \
|
||||||
|
$(MAKE) -C $$dir h/zephyr_version.h; $(MAKE) -C $$dir/lib all $(CHECK); $(MAKE) -C $$dir/server; \
|
||||||
|
done
|
||||||
|
$(MAKE) -C no-krb all $(CHECK)
|
||||||
|
|
||||||
|
touch build-stamp
|
||||||
|
|
||||||
|
clean:
|
||||||
|
dh_testdir
|
||||||
|
dh_testroot
|
||||||
|
-rm -f build-stamp configure-stamp
|
||||||
|
|
||||||
|
# Add here commands to clean up after the build process.
|
||||||
|
-rm -rf autom4te.cache m4
|
||||||
|
-rm aclocal.m4 config.guess config.sub configure h/config.h.in \
|
||||||
|
install-sh ltmain.sh
|
||||||
|
-rm -rf $(VARIETALS) no-krb debian/tmp-krb*
|
||||||
|
-rm debian/zephyr-server-krb.files
|
||||||
|
-rm debian/zephyr-server-krb.templates
|
||||||
|
-rm debian/zephyr-server-krb.config
|
||||||
|
-rm debian/zephyr-server-krb.postinst
|
||||||
|
-rm debian/zephyr-server-krb5.README.Debian \
|
||||||
|
debian/zephyr-server-krb5.docs debian/zephyr-server-krb5.files \
|
||||||
|
debian/zephyr-server-krb5.postinst debian/zephyr-server-krb5.postrm \
|
||||||
|
debian/zephyr-server-krb5.templates
|
||||||
|
-rm debian/zephyr-server-krb45.*
|
||||||
|
-rm debian/libzephyr4-krb.files debian/libzephyr4-krb5.files \
|
||||||
|
debian/libzephyr4-krb45.files
|
||||||
|
|
||||||
|
dh_clean -XTAGS
|
||||||
|
|
||||||
|
install: DH_OPTIONS=
|
||||||
|
install: build
|
||||||
|
dh_testdir
|
||||||
|
dh_testroot
|
||||||
|
dh_prep -XTAGS
|
||||||
|
-rm -rf debian/tmp-krb*
|
||||||
|
dh_installdirs
|
||||||
|
|
||||||
|
# Add here commands to install the package into debian/tmp.
|
||||||
|
$(MAKE) -C no-krb DESTDIR=$(CURDIR)/debian/tmp install
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
$(MAKE) -C $$dir SUBDIRS="lib server" DESTDIR=$(CURDIR)/debian/tmp-$$dir install; \
|
||||||
|
done
|
||||||
|
mkdir -p debian/tmp/etc/zephyr/acl
|
||||||
|
set -x; for i in debian/acl/*; do install -c -m 644 -o root $$i debian/tmp/etc/zephyr/acl; done; set +x
|
||||||
|
install -c -m 644 debian/zephyr.vars debian/tmp/etc/zephyr
|
||||||
|
install -c -m 644 debian/default.subscriptions debian/tmp/etc/zephyr
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
cp -rp debian/tmp/etc/zephyr/acl debian/tmp-$$dir/etc/zephyr; \
|
||||||
|
done
|
||||||
|
mkdir -p debian/tmp/usr/lib/python2.5/site-packages
|
||||||
|
install -c -m 644 python/zephyr_ctypes.py debian/tmp/usr/lib/python2.5/site-packages
|
||||||
|
|
||||||
|
# Build architecture-independent files here.
|
||||||
|
# Pass -i to all debhelper commands in this target to reduce clutter.
|
||||||
|
binary-indep: build install
|
||||||
|
|
||||||
|
# Build architecture-dependent files here.
|
||||||
|
# Pass -a to all debhelper commands in this target to reduce clutter.
|
||||||
|
binary-arch: build install
|
||||||
|
dh_testdir
|
||||||
|
dh_testroot
|
||||||
|
set -e; \
|
||||||
|
for file in files templates postinst docs; do \
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
cp debian/zephyr-server.$$file debian/zephyr-server-$$dir.$$file; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
for file in config init; do \
|
||||||
|
for dir in $(filter-out krb5,$(VARIETALS)); do \
|
||||||
|
cp debian/zephyr-server.$$file debian/zephyr-server-$$dir.$$file; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
for file in README.Debian docs postrm; do \
|
||||||
|
for dir in $(filter-out krb,$(VARIETALS)); do \
|
||||||
|
cp debian/zephyr-server-krb.$$file debian/zephyr-server-$$dir.$$file; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
cp debian/libzephyr4.files debian/libzephyr4-$$dir.files; \
|
||||||
|
done
|
||||||
|
dh_movefiles -plibzephyr4 -pzephyr-clients -pzephyr-server -plibzephyr-dev -plibzephyr-python
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
dh_movefiles --sourcedir=debian/tmp-$$dir -plibzephyr4-$$dir -pzephyr-server-$$dir; \
|
||||||
|
done
|
||||||
|
dh_installdebconf
|
||||||
|
dh_installdocs
|
||||||
|
dh_installinit -pzephyr-clients --init-script=zhm --no-start
|
||||||
|
dh_installinit -pzephyr-server --init-script=zephyrd
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
dh_installinit -pzephyr-server-$$dir --init-script=zephyrd; \
|
||||||
|
done
|
||||||
|
dh_installchangelogs
|
||||||
|
dh_pycentral -plibzephyr-python
|
||||||
|
dh_python -plibzephyr-python
|
||||||
|
dh_strip
|
||||||
|
dh_compress
|
||||||
|
dh_fixperms
|
||||||
|
dh_makeshlibs
|
||||||
|
# sigh
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-$$dir/DEBIAN/shlibs; \
|
||||||
|
done
|
||||||
|
dh_shlibdeps $(PACKAGES)
|
||||||
|
dh_installdeb $(PACKAGES)
|
||||||
|
dh_gencontrol $(PACKAGES)
|
||||||
|
dh_md5sums $(PACKAGES)
|
||||||
|
dh_builddeb $(PACKAGES)
|
||||||
|
for dir in $(VARIETALS); do \
|
||||||
|
dh_builddeb --sourcedir=debian/tmp-$$dir -plibzephyr4-$$dir -pzephyr-server-$$dir; \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
binary: binary-indep binary-arch
|
||||||
|
|
||||||
|
.PHONY: build clean binary-indep binary-arch binary install
|
42
debian/zephyr-clients.config
vendored
Normal file
42
debian/zephyr-clients.config
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
. /usr/share/debconf/confmodule
|
||||||
|
db_version 2.0
|
||||||
|
|
||||||
|
db_get zephyr-clients/servers || true
|
||||||
|
if test -z "$RET"
|
||||||
|
then
|
||||||
|
# If there's an /etc/zephyr/server.list file lying around, read it
|
||||||
|
if test -f /etc/zephyr/server.list
|
||||||
|
then
|
||||||
|
z="`cat /etc/zephyr/server.list`"
|
||||||
|
|
||||||
|
if test -n "$z"
|
||||||
|
then
|
||||||
|
db_set zephyr-clients/servers "`echo $z`"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# if there happens to be zephyr server decconf on this machine,
|
||||||
|
# see what its debconf knows about zephyr servers...
|
||||||
|
if db_get zephyr-server/servers && test -n "$RET"
|
||||||
|
then
|
||||||
|
db_set zephyr-clients/servers $RET
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
db_get zephyr-clients/read_conf
|
||||||
|
if test -f /etc/default/zephyr-clients -a \( "$RET" = true \)
|
||||||
|
then
|
||||||
|
zhm_args=""
|
||||||
|
. /etc/default/zephyr-clients
|
||||||
|
if test -n "$zhm_args"
|
||||||
|
then
|
||||||
|
db_set zephyr-clients/read_conf false
|
||||||
|
db_set zephyr-clients/servers "$zhm_args"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
db_input high zephyr-clients/servers || true
|
||||||
|
|
||||||
|
db_go || true
|
1
debian/zephyr-clients.docs
vendored
Normal file
1
debian/zephyr-clients.docs
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
USING
|
24
debian/zephyr-clients.files
vendored
Normal file
24
debian/zephyr-clients.files
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
usr/bin/zaway
|
||||||
|
usr/bin/zctl
|
||||||
|
usr/bin/zleave
|
||||||
|
usr/bin/zlocate
|
||||||
|
usr/bin/znol
|
||||||
|
usr/bin/zstat
|
||||||
|
usr/bin/zwrite
|
||||||
|
usr/bin/zwgc
|
||||||
|
usr/sbin/zshutdown_notify
|
||||||
|
usr/sbin/zhm
|
||||||
|
usr/share/man/man1/zephyr.1
|
||||||
|
usr/share/man/man1/zaway.1
|
||||||
|
usr/share/man/man1/zctl.1
|
||||||
|
usr/share/man/man1/zleave.1
|
||||||
|
usr/share/man/man1/zlocate.1
|
||||||
|
usr/share/man/man1/znol.1
|
||||||
|
usr/share/man/man1/zwrite.1
|
||||||
|
usr/share/man/man1/zwgc.1
|
||||||
|
usr/share/man/man8/zshutdown_notify.8
|
||||||
|
usr/share/man/man8/zstat.8
|
||||||
|
usr/share/man/man8/zhm.8
|
||||||
|
etc/zephyr/zwgc.desc
|
||||||
|
etc/zephyr/zwgc_resources
|
||||||
|
etc/zephyr/zephyr.vars
|
74
debian/zephyr-clients.init
vendored
Normal file
74
debian/zephyr-clients.init
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# skeleton example file to build /etc/init.d/ scripts.
|
||||||
|
# This file should be used to construct scripts for /etc/init.d.
|
||||||
|
#
|
||||||
|
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
|
||||||
|
# Modified for Debian GNU/Linux
|
||||||
|
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
|
||||||
|
#
|
||||||
|
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
|
||||||
|
#
|
||||||
|
# This file was automatically customized by dh-make on Mon, 4 Dec 2000 05:28:22 -0500
|
||||||
|
|
||||||
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
DAEMON=/usr/sbin/zhm
|
||||||
|
NAME=zhm
|
||||||
|
DESC="zephyr host manager"
|
||||||
|
|
||||||
|
test -f $DAEMON || exit 0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if test -f /etc/default/zephyr-clients
|
||||||
|
then
|
||||||
|
. /etc/default/zephyr-clients
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting $DESC: "
|
||||||
|
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
||||||
|
--exec $DAEMON -- $zhm_args
|
||||||
|
echo "$NAME."
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping $DESC: "
|
||||||
|
start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
|
||||||
|
--name $NAME
|
||||||
|
echo "$NAME."-
|
||||||
|
;;
|
||||||
|
restart|force-reload)
|
||||||
|
#
|
||||||
|
# If the "reload" option is implemented, move the "force-reload"
|
||||||
|
# option to the "reload" entry above. If not, "force-reload" is
|
||||||
|
# just the same as "restart".
|
||||||
|
#
|
||||||
|
echo -n "Restarting $DESC: "
|
||||||
|
start-stop-daemon --oknodo --stop --retry 5 --quiet --pidfile \
|
||||||
|
/var/run/$NAME.pid --name $NAME
|
||||||
|
start-stop-daemon --start --quiet --pidfile \
|
||||||
|
/var/run/$NAME.pid --exec $DAEMON -- -N $zhm_args
|
||||||
|
echo "$NAME."
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
N=/etc/init.d/$NAME
|
||||||
|
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
||||||
|
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: zhm
|
||||||
|
# Required-Start: $syslog $network $remote_fs
|
||||||
|
# Required-Stop: $syslog $remote_fs
|
||||||
|
# Should-Stop: $network
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: Start the zephyr host manager daemon.
|
||||||
|
# Description: Start the zephyr host manager daemon.
|
||||||
|
### END INIT INFO
|
||||||
|
|
84
debian/zephyr-clients.postinst
vendored
Normal file
84
debian/zephyr-clients.postinst
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# postinst script for zephyr
|
||||||
|
#
|
||||||
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# summary of how this script can be called:
|
||||||
|
# * <postinst> `configure' <most-recently-configured-version>
|
||||||
|
# * <old-postinst> `abort-upgrade' <new version>
|
||||||
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||||
|
# <new-version>
|
||||||
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||||
|
# <failed-install-package> <version> `removing'
|
||||||
|
# <conflicting-package> <version>
|
||||||
|
# for details, see /usr/share/doc/packaging-manual/
|
||||||
|
#
|
||||||
|
# quoting from the policy:
|
||||||
|
# Any necessary prompting should almost always be confined to the
|
||||||
|
# post-installation script, and should be protected with a conditional
|
||||||
|
# so that unnecessary prompting doesn't happen if a package's
|
||||||
|
# installation fails and the `postinst' is called with `abort-upgrade',
|
||||||
|
# `abort-remove' or `abort-deconfigure'.
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
configure)
|
||||||
|
|
||||||
|
. /usr/share/debconf/confmodule
|
||||||
|
db_version 2.0
|
||||||
|
|
||||||
|
db_set zephyr-clients/read_conf true
|
||||||
|
|
||||||
|
if test -f /etc/zephyr/zephyr.conf
|
||||||
|
then
|
||||||
|
if test ! -f /etc/default/zephyr-clients
|
||||||
|
then
|
||||||
|
mv /etc/zephyr/zephyr.conf /etc/default/zephyr-clients
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if /etc/default/zephyr-clients already exists and has a zhm_args
|
||||||
|
# line, the config script should have sucked it into debconf
|
||||||
|
db_get zephyr-clients/servers || true
|
||||||
|
|
||||||
|
tmpfile=/etc/default/zephyr-client.dpkg-new
|
||||||
|
if test -f /etc/default/zephyr-clients
|
||||||
|
then
|
||||||
|
grep -v ^zhm_args /etc/default/zephyr-clients > $tmpfile || true
|
||||||
|
else
|
||||||
|
cat > $tmpfile << EOF
|
||||||
|
# This file is automatically rewritten by the zephyr-clients post-install
|
||||||
|
# script. So treat it right.
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
echo zhm_args=\"${RET}\" >> $tmpfile
|
||||||
|
cat $tmpfile > /etc/default/zephyr-clients
|
||||||
|
rm $tmpfile
|
||||||
|
;;
|
||||||
|
|
||||||
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "postinst called with unknown argument \`$1'" >&2
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "/etc/init.d/zhm" ]; then
|
||||||
|
# this script does not necessarily fail if these do
|
||||||
|
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
|
||||||
|
invoke-rc.d zhm restart
|
||||||
|
else
|
||||||
|
/etc/init.d/zhm restart
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# dh_installdeb will replace this with shell code automatically
|
||||||
|
# generated by other debhelper scripts.
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user