summaryrefslogtreecommitdiff
path: root/clients/zshutdown_notify/zshutdown_notify.c
diff options
context:
space:
mode:
authorGravatar Richard Basch <probe@mit.edu>1993-11-20 22:25:45 +0000
committerGravatar Richard Basch <probe@mit.edu>1993-11-20 22:25:45 +0000
commitc491ad07b7fc544d626ab132ac5e314d0d83df2a (patch)
tree439a5ef42baea039b972f98f0713039fe5081581 /clients/zshutdown_notify/zshutdown_notify.c
parentd179596961871958eab8c51b27529575e2a9e92c (diff)
Changed KERBEROS to Z_HaveKerberos
Return status 0 if successful Changed rcsid string
Diffstat (limited to 'clients/zshutdown_notify/zshutdown_notify.c')
-rw-r--r--clients/zshutdown_notify/zshutdown_notify.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/clients/zshutdown_notify/zshutdown_notify.c b/clients/zshutdown_notify/zshutdown_notify.c
index bbc7abb..662f6ae 100644
--- a/clients/zshutdown_notify/zshutdown_notify.c
+++ b/clients/zshutdown_notify/zshutdown_notify.c
@@ -4,17 +4,16 @@
*
* Created by: C. Anthony Della Fera
*
- * $Source$
- * $Author$
+ * $Id$
*
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
+ * Copyright (c) 1987, 1993 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
* "mit-copyright.h".
*/
#include <zephyr/mit-copyright.h>
-
#include <zephyr/zephyr.h>
+
#include <sys/param.h>
#include <sys/socket.h>
#include <netdb.h>
@@ -22,10 +21,9 @@
#include <string.h>
#ifndef lint
-#ifndef SABER
-static char *rcsid_zshutdown_notify_c = "$Header$";
-#endif /* SABER */
-#endif /* lint */
+static char *rcsid_zshutdown_notify_c =
+ "$Id$";
+#endif
#define N_KIND UNSAFE
#define N_CLASS "FILSRV"
@@ -33,7 +31,7 @@ static char *rcsid_zshutdown_notify_c = "$Header$";
#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 KERBEROS
+#ifdef Z_HaveKerberos
#define SVC_NAME "rcmd"
#endif
@@ -55,7 +53,7 @@ main(argc,argv)
char hostname[MAXHOSTNAMELEN];
char msgbuff[BUFSIZ], message[Z_MAXPKTLEN], *ptr;
char *msg[N_FIELD_CNT];
-#ifdef KERBEROS
+#ifdef Z_HaveKerberos
char tkt_filename[MAXPATHLEN];
char rlm[REALM_SZ];
char hn2[MAXHOSTNAMELEN];
@@ -75,7 +73,7 @@ main(argc,argv)
if ((hp = gethostbyname(hostname)) != NULL)
(void) strcpy(hostname, hp->h_name);
-#ifdef KERBEROS
+#ifdef Z_HaveKerberos
(void) sprintf(tkt_filename, "/tmp/tkt_zshut_%d", getpid());
krb_set_tkt_string(tkt_filename);
@@ -129,14 +127,14 @@ main(argc,argv)
notice.z_recipient = "";
notice.z_default_format = N_DEF_FORMAT;
- if ((retval = ZSendList(&notice, msg, N_FIELD_CNT, ZAUTH)) != ZERR_NONE) {
- com_err(argv[0], retval, "while sending notice");
-#ifdef KERBEROS
- (void) dest_tkt();
-#endif
- exit(1);
- }
-#ifdef KERBEROS
+ retval = ZSendList(&notice, msg, N_FIELD_CNT, ZAUTH);
+#ifdef Z_HaveKerberos
(void) dest_tkt();
#endif
+
+ if (retval != ZERR_NONE) {
+ com_err(argv[0], retval, "while sending notice");
+ exit(1);
+ }
+ return 0;
}