summaryrefslogtreecommitdiff
path: root/clients/zshutdown_notify
diff options
context:
space:
mode:
Diffstat (limited to 'clients/zshutdown_notify')
-rw-r--r--clients/zshutdown_notify/Imakefile16
-rw-r--r--clients/zshutdown_notify/Makefile.in47
-rw-r--r--clients/zshutdown_notify/zshutdown_notify.c18
3 files changed, 55 insertions, 26 deletions
diff --git a/clients/zshutdown_notify/Imakefile b/clients/zshutdown_notify/Imakefile
deleted file mode 100644
index 9dc7ace..0000000
--- a/clients/zshutdown_notify/Imakefile
+++ /dev/null
@@ -1,16 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zshutdown_notify.c
-OBJS = zshutdown_notify.o
-
-SimpleProgram(zshutdown_notify,$(OBJS) $(ZLIB),$(ZLIBS),$(ATHRETCDIR))
-install_man(zshutdown_notify.8,zshutdown_notify.8)
-create_depend($(SRCS))
diff --git a/clients/zshutdown_notify/Makefile.in b/clients/zshutdown_notify/Makefile.in
new file mode 100644
index 0000000..0fb5922
--- /dev/null
+++ b/clients/zshutdown_notify/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zshutdown_notify.o
+
+all: zshutdown_notify
+
+zshutdown_notify: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zshutdown_notify
+ ${INSTALL} -m 755 -s zshutdown_notify ${DESTDIR}${lsbindir}
+ ${INSTALL} -m 644 ${srcdir}/zshutdown_notify.8 ${DESTDIR}${mandir}/man8
+
+clean:
+ rm -f ${OBJS} zshutdown_notify
+
+${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
+
diff --git a/clients/zshutdown_notify/zshutdown_notify.c b/clients/zshutdown_notify/zshutdown_notify.c
index 99a3fce..e7727e6 100644
--- a/clients/zshutdown_notify/zshutdown_notify.c
+++ b/clients/zshutdown_notify/zshutdown_notify.c
@@ -11,17 +11,15 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
#ifndef lint
-static char *rcsid_zshutdown_notify_c =
+static const char *rcsid_zshutdown_notify_c =
"$Id$";
#endif
@@ -31,7 +29,7 @@ static char *rcsid_zshutdown_notify_c =
#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 Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
#define SVC_NAME "rcmd"
#endif
@@ -54,7 +52,7 @@ main(argc,argv)
char msgbuff[BUFSIZ], message[Z_MAXPKTLEN], *ptr;
char scratch[BUFSIZ];
char *msg[N_FIELD_CNT];
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
char tkt_filename[MAXPATHLEN];
char rlm[REALM_SZ];
char hn2[MAXHOSTNAMELEN];
@@ -75,7 +73,7 @@ main(argc,argv)
sprintf(scratch, warning, hostname);
msg[2] = scratch;
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
(void) sprintf(tkt_filename, "/tmp/tkt_zshut_%d", getpid());
krb_set_tkt_string(tkt_filename);
@@ -88,14 +86,14 @@ main(argc,argv)
}
if (retval = krb_get_lrealm(rlm, 1)) {
fprintf(stderr, "%s: can't get local realm: %s\n",
- argv[0], krb_err_txt[retval]);
+ argv[0], krb_get_err_text(retval));
exit(1);
}
if (retval = krb_get_svc_in_tkt(SVC_NAME, hn2, rlm,
SERVER_SERVICE, SERVER_INSTANCE, 1,
KEYFILE)) {
fprintf(stderr, "%s: can't get tickets: %s\n",
- argv[0], krb_err_txt[retval]);
+ argv[0], krb_get_err_text(retval));
exit(1);
}
#endif
@@ -130,7 +128,7 @@ main(argc,argv)
notice.z_default_format = N_DEF_FORMAT;
retval = ZSendList(&notice, msg, N_FIELD_CNT, ZAUTH);
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
(void) dest_tkt();
#endif