/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
* All Rights Reserved.
*/
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted provided
* that: (1) source distributions retain this entire copyright notice and
* comment, and (2) distributions including binaries display the following
* acknowledgement: ``This product includes software developed by the
* University of California, Berkeley and its contributors'' in the
* documentation or other materials provided with the distribution and in
* all advertising materials mentioning features or use of this software.
* Neither the name of the University nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <utmpx.h>
#include <signal.h>
#include <errno.h>
#include <netdb.h>
#include <syslog.h>
#include <pwd.h>
/*
* comsat
*/
#ifndef UTMPX_FILE
#endif /* UTMPX_FILE */
int debug = 0;
int nutmp;
int uf;
#ifndef SYSV
int reapchildren();
#else
#ifndef sigmask
#endif
static int
int mask;
{
}
static int
int mask;
{
}
#endif /* SYSV */
int
int argc;
char *argv[];
{
register int cc;
int c;
extern int optind;
extern int getopt();
extern char *optarg;
switch ((char)c) {
case'd':
debug++;
break;
default:
exit(1);
}
}
/* verify proper invocation */
perror("getsockname");
_exit(1);
}
#ifdef SYSV
#else
#endif /* SYSV */
exit(1);
}
(void) time(&lastmsgtime);
onalrm(0);
#ifndef SYSV
#else
#endif /* SYSV */
for (;;) {
if (cc <= 0) {
sleep(1);
errno = 0;
continue;
}
if (nutmp == 0) /* no users (yet) */
continue;
(void) time(&lastmsgtime);
sigsetmask(0);
}
}
#ifndef SYSV
{
;
}
#endif /* SYSV */
/* ARGSUSED */
void
{
exit(0);
alarm(15);
if (utmp)
else
if (! utmp) {
exit(1);
}
}
} else
}
void
char *name;
{
register char *cp;
char *rindex();
int offset;
/*
* Don't bother doing anything if nobody is
* logged into the system.
*/
return;
cp++;
if (*cp == 0) {
return;
}
*cp = 0;
}
char *cr;
void
{
return;
}
return;
}
if (fork())
return;
alarm(30);
/*
* Do all operations that check protections as the user who
* will be getting the biff.
*/
exit(1);
}
exit(1);
}
/*
* We need to make sure that the tty listed in the utmp
* file really is a tty device so that a corrupted utmp
* file doesn't cause us to over-write a real file.
*/
exit(1);
}
exit(1);
}
/*
* For the case where the user getting the biff is root,
* we need to make sure that the tty we will be sending
* the biff to is also owned by root.
*
* Check after open, to prevent race on open.
*/
"tty is not owned by user getting the biff\n");
exit(1);
}
/*
* Prevent race by doing fdopen on fd, not fopen
* Fopen opens w/ O_CREAT, which is dangerous too
*/
exit(-1);
}
exit(1);
}
exit(1);
}
/*
* In case of a worldwritable mail spool directory, we must take
* care we don't open and read from the wrong file.
*/
exit(1);
}
/*
* Here we make sure that the file wasn't a hardlink or softlink
* while we opened it and that it wasn't changed afterwards
*/
exit(1);
}
exit(0);
}
void
char *name;
int mbox;
{
int inheader;
return;
}
/*
* Print the first 7 lines or 560 characters of the new mail
* (whichever comes first). Skip header crap other than
* From, Subject, To, and Date.
*/
linecnt = 7;
charcnt = 560;
inheader = 1;
register char *cp;
char *index();
int cnt;
int i;
return;
}
continue;
continue;
inheader = 0;
else
if (inheader &&
continue;
if (cp)
*cp = '\0';
line[i] = ' ';
}
}