version 1.27, 2013/04/16 19:24:55 |
version 1.28, 2015/01/16 06:40:14 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#include <sys/param.h> |
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <stdio.h> |
#include <stdio.h> |
|
|
#include <paths.h> |
#include <paths.h> |
#include <pwd.h> |
#include <pwd.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
#include <utmp.h> |
#include <utmp.h> |
#include <err.h> |
#include <err.h> |
#include <vis.h> |
#include <vis.h> |
|
|
int |
int |
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
char tty[MAXPATHLEN], *mytty, *cp; |
char tty[PATH_MAX], *mytty, *cp; |
int msgsok, myttyfd; |
int msgsok, myttyfd; |
time_t atime; |
time_t atime; |
uid_t myuid; |
uid_t myuid; |
|
|
term_chk(char *tty, int *msgsokP, time_t *atimeP, int showerror) |
term_chk(char *tty, int *msgsokP, time_t *atimeP, int showerror) |
{ |
{ |
struct stat s; |
struct stat s; |
char path[MAXPATHLEN]; |
char path[PATH_MAX]; |
|
|
(void)snprintf(path, sizeof(path), "%s%s", _PATH_DEV, tty); |
(void)snprintf(path, sizeof(path), "%s%s", _PATH_DEV, tty); |
if (stat(path, &s) < 0) { |
if (stat(path, &s) < 0) { |
|
|
char *login, *nows; |
char *login, *nows; |
struct passwd *pwd; |
struct passwd *pwd; |
time_t now; |
time_t now; |
char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512]; |
char path[PATH_MAX], host[HOST_NAME_MAX+1], line[512]; |
gid_t gid; |
gid_t gid; |
|
|
/* Determine our login name before the we reopen() stdout */ |
/* Determine our login name before the we reopen() stdout */ |