summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/trigger.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.bin/cvs/trigger.c
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
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 'usr.bin/cvs/trigger.c')
-rw-r--r--usr.bin/cvs/trigger.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/trigger.c b/usr.bin/cvs/trigger.c
index 5fc306408af..20a5e4dd650 100644
--- a/usr.bin/cvs/trigger.c
+++ b/usr.bin/cvs/trigger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trigger.c,v 1.21 2014/01/08 13:23:55 okan Exp $ */
+/* $OpenBSD: trigger.c,v 1.22 2015/01/16 06:40:07 deraadt Exp $ */
/*
* Copyright (c) 2008 Tobias Stoeckmann <tobias@openbsd.org>
* Copyright (c) 2008 Jonathan Armani <dbd@asystant.net>
@@ -382,7 +382,7 @@ cvs_trigger_getlines(char * file, char * repo)
regex_t preg;
struct trigger_list *list;
struct trigger_line *tline;
- char fpath[MAXPATHLEN];
+ char fpath[PATH_MAX];
char *currentline, *defaultline = NULL, *nline, *p, *q, *regex;
if (strcmp(file, CVS_PATH_EDITINFO) == 0 ||
@@ -391,7 +391,7 @@ cvs_trigger_getlines(char * file, char * repo)
else
allow_all = 1;
- (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", current_cvsroot->cr_dir,
+ (void)xsnprintf(fpath, PATH_MAX, "%s/%s", current_cvsroot->cr_dir,
file);
if ((fp = fopen(fpath, "r")) == NULL) {
@@ -535,8 +535,8 @@ cvs_trigger_freeinfo(struct file_info_list * list)
void
cvs_trigger_loginfo_header(BUF *buf, char *repo)
{
- char *dir, pwd[MAXPATHLEN];
- char hostname[MAXHOSTNAMELEN];
+ char *dir, pwd[PATH_MAX];
+ char hostname[HOST_NAME_MAX+1];
if (gethostname(hostname, sizeof(hostname)) == -1) {
fatal("cvs_trigger_loginfo_header: gethostname failed %s",