I supressed the sending of messages to sleeper.
authorBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 13 Jun 1981 04:24:07 +0000 (20:24 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 13 Jun 1981 04:24:07 +0000 (20:24 -0800)
SCCS-vsn: sbin/shutdown/shutdown.c 4.10

usr/src/sbin/shutdown/shutdown.c

index 5f9ad67..4dfe943 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)shutdown.c  4.9 (Berkeley) 81/06/11";
+static char *sccsid = "@(#)shutdown.c  4.10 (Berkeley) 81/06/12";
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -19,6 +19,7 @@ static        char *sccsid = "@(#)shutdown.c  4.9 (Berkeley) 81/06/11";
  *             Peter Lamb, Melbourne, 1980
  *             William Joy, Berkeley, 1981
  *             Michael Toy, Berkeley, 1981
  *             Peter Lamb, Melbourne, 1980
  *             William Joy, Berkeley, 1981
  *             Michael Toy, Berkeley, 1981
+ *             Dave Presotto, Berkeley, 1981
  */
 #ifdef DEBUG
 #define LOGFILE "shutdown.log"
  */
 #ifdef DEBUG
 #define LOGFILE "shutdown.log"
@@ -33,6 +34,7 @@ static        char *sccsid = "@(#)shutdown.c  4.9 (Berkeley) 81/06/11";
 #define SECONDS
 #define NLOG           20              /* no of args possible for message */
 #define        NOLOGTIME       5 MINUTES
 #define SECONDS
 #define NLOG           20              /* no of args possible for message */
 #define        NOLOGTIME       5 MINUTES
+#define IGNOREUSER     "sleeper"
 
 int    do_nothing();
 time_t getsdt();
 
 int    do_nothing();
 time_t getsdt();
@@ -159,7 +161,8 @@ main(argc,argv)
                ufd = open("/etc/utmp",0);
                nowtime = time((long *) 0);
                while (read(ufd,&utmp,sizeof utmp)==sizeof utmp)
                ufd = open("/etc/utmp",0);
                nowtime = time((long *) 0);
                while (read(ufd,&utmp,sizeof utmp)==sizeof utmp)
-               if (utmp.ut_name[0]) {
+               if (utmp.ut_name[0] &&
+                   strncmp(utmp.ut_name, IGNOREUSER, sizeof(utmp.ut_name))) {
                        strcpy(term, tpath);
                        strncat(term, utmp.ut_line, sizeof utmp.ut_line);
                        alarm(3);
                        strcpy(term, tpath);
                        strncat(term, utmp.ut_line, sizeof utmp.ut_line);
                        alarm(3);