summaryrefslogtreecommitdiff
path: root/libexec/comsat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /libexec/comsat
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'libexec/comsat')
-rw-r--r--libexec/comsat/comsat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
index 0e4b0a5cc22..b77ef5aa13b 100644
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comsat.c,v 1.37 2012/12/04 02:24:47 deraadt Exp $ */
+/* $OpenBSD: comsat.c,v 1.38 2015/01/16 06:39:49 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -40,6 +40,7 @@
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
+#include <limits.h>
#include <paths.h>
#include <pwd.h>
#include <signal.h>
@@ -57,7 +58,7 @@ int debug = 0;
#define MAXIDLE 120
-char hostname[MAXHOSTNAMELEN];
+char hostname[HOST_NAME_MAX+1];
struct utmp *utmp = NULL;
time_t lastmsgtime;
int nutmp, uf;
@@ -222,7 +223,7 @@ notify(struct utmp *utp, off_t offset)
FILE *tp;
struct stat stb;
struct termios ttybuf;
- char tty[MAXPATHLEN], name[UT_NAMESIZE + 1];
+ char tty[PATH_MAX], name[UT_NAMESIZE + 1];
(void)snprintf(tty, sizeof(tty), "%s%.*s",
_PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line);