diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
commit | 315054f4737a39489e0a14f3a92bff61f1592832 (patch) | |
tree | 62bf010653374ce09b6beb4dfa0414a91457233b /libexec/talkd | |
parent | 79e3d817585ca08a91e30ad14abe43e2ab70295f (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/talkd')
-rw-r--r-- | libexec/talkd/announce.c | 6 | ||||
-rw-r--r-- | libexec/talkd/process.c | 6 | ||||
-rw-r--r-- | libexec/talkd/table.c | 3 | ||||
-rw-r--r-- | libexec/talkd/talkd.c | 6 |
4 files changed, 10 insertions, 11 deletions
diff --git a/libexec/talkd/announce.c b/libexec/talkd/announce.c index 1ba6286d536..421b9663fa9 100644 --- a/libexec/talkd/announce.c +++ b/libexec/talkd/announce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: announce.c,v 1.22 2013/04/17 17:40:53 deraadt Exp $ */ +/* $OpenBSD: announce.c,v 1.23 2015/01/16 06:39:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> @@ -39,6 +38,7 @@ #include <errno.h> #include <syslog.h> #include <unistd.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -55,7 +55,7 @@ static void print_mesg(FILE *,CTL_MSG *,char *); int announce(CTL_MSG *request, char *remote_machine) { - char full_tty[MAXPATHLEN]; + char full_tty[PATH_MAX]; FILE *tf; struct stat stbuf; diff --git a/libexec/talkd/process.c b/libexec/talkd/process.c index 49c627e0f28..91b10ee4818 100644 --- a/libexec/talkd/process.c +++ b/libexec/talkd/process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process.c,v 1.20 2013/11/27 21:25:24 deraadt Exp $ */ +/* $OpenBSD: process.c,v 1.21 2015/01/16 06:39:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -37,7 +37,6 @@ * in the table for the local user * DELETE - delete invitation */ -#include <sys/param.h> #include <sys/stat.h> #include <sys/socket.h> #include <netinet/in.h> @@ -49,6 +48,7 @@ #include <string.h> #include <ctype.h> #include <paths.h> +#include <limits.h> #include "talkd.h" #define satosin(sa) ((struct sockaddr_in *)(sa)) @@ -192,7 +192,7 @@ find_user(char *name, char *tty, size_t ttyl) int status; FILE *fp; char line[UT_LINESIZE+1]; - char ftty[MAXPATHLEN]; + char ftty[PATH_MAX]; time_t idle, now; time(&now); diff --git a/libexec/talkd/table.c b/libexec/talkd/table.c index c75b1f76783..556ddfd4d66 100644 --- a/libexec/talkd/table.c +++ b/libexec/talkd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.15 2014/10/08 02:10:05 deraadt Exp $ */ +/* $OpenBSD: table.c,v 1.16 2015/01/16 06:39:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -37,7 +37,6 @@ * * Consider this a mis-guided attempt at modularity */ -#include <sys/param.h> #include <sys/time.h> #include <sys/socket.h> #include <sys/queue.h> diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c index ee2e7be2bad..f28d7acf071 100644 --- a/libexec/talkd/talkd.c +++ b/libexec/talkd/talkd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: talkd.c,v 1.22 2009/10/27 23:59:31 deraadt Exp $ */ +/* $OpenBSD: talkd.c,v 1.23 2015/01/16 06:39:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,6 @@ * disconnect all descriptors and ttys, and then endless * loop on waiting for and processing requests */ -#include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> #include <protocols/talkd.h> @@ -44,6 +43,7 @@ #include <time.h> #include <errno.h> #include <unistd.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -54,7 +54,7 @@ int debug = 0; void timeout(int); long lastmsgtime; -char hostname[MAXHOSTNAMELEN]; +char hostname[HOST_NAME_MAX+1]; #define TIMEOUT 30 #define MAXIDLE 120 |