summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/repository.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/repository.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/repository.c')
-rw-r--r--usr.bin/cvs/repository.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/cvs/repository.c b/usr.bin/cvs/repository.c
index c2df4be05e6..a5d0fa761ac 100644
--- a/usr.bin/cvs/repository.c
+++ b/usr.bin/cvs/repository.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: repository.c,v 1.23 2010/07/23 08:31:19 ray Exp $ */
+/* $OpenBSD: repository.c,v 1.24 2015/01/16 06:40:07 deraadt Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -30,7 +30,7 @@ struct wklhead repo_locks;
void
cvs_repository_unlock(const char *repo)
{
- char fpath[MAXPATHLEN];
+ char fpath[PATH_MAX];
cvs_log(LP_TRACE, "cvs_repository_unlock(%s)", repo);
@@ -46,7 +46,7 @@ cvs_repository_lock(const char *repo, int wantlock)
int i;
uid_t myuid;
struct stat st;
- char fpath[MAXPATHLEN];
+ char fpath[PATH_MAX];
struct passwd *pw;
if (cvs_noexec == 1 || cvs_readonlyfs == 1)
@@ -102,7 +102,7 @@ cvs_repository_getdir(const char *dir, const char *wdir,
DIR *dirp;
struct stat st;
struct dirent *dp;
- char *s, fpath[MAXPATHLEN], rpath[MAXPATHLEN];
+ char *s, fpath[PATH_MAX], rpath[PATH_MAX];
if ((dirp = opendir(dir)) == NULL)
fatal("cvs_repository_getdir: failed to open '%s'", dir);
@@ -113,8 +113,8 @@ cvs_repository_getdir(const char *dir, const char *wdir,
!strcmp(dp->d_name, CVS_LOCK))
continue;
- (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", wdir, dp->d_name);
- (void)xsnprintf(rpath, MAXPATHLEN, "%s/%s", dir, dp->d_name);
+ (void)xsnprintf(fpath, PATH_MAX, "%s/%s", wdir, dp->d_name);
+ (void)xsnprintf(rpath, PATH_MAX, "%s/%s", dir, dp->d_name);
if (!TAILQ_EMPTY(&checkout_ign_pats)) {
if ((s = strrchr(fpath, ',')) != NULL)