From 173dc8749401a03b492e3d8eaa9358ba3cce4e24 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 2 Sep 2021 21:06:06 +0000 Subject: [PATCH] remove sys/param.h that snuck in, by replacing MAXPATHLEN with PATH_MAX --- usr.bin/rsync/flist.c | 10 +++++----- usr.bin/rsync/session.c | 3 +-- usr.bin/rsync/symlinks.c | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/usr.bin/rsync/flist.c b/usr.bin/rsync/flist.c index 86cde1dd3d3..392ba494423 100644 --- a/usr.bin/rsync/flist.c +++ b/usr.bin/rsync/flist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: flist.c,v 1.33 2021/08/29 13:43:46 claudio Exp $ */ +/* $OpenBSD: flist.c,v 1.34 2021/09/02 21:06:06 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser @@ -15,13 +15,13 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include #include #include +#include #include #include #include @@ -428,7 +428,7 @@ out: */ static int flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, - char last[MAXPATHLEN]) + char last[PATH_MAX]) { uint8_t bval; size_t partial = 0; @@ -504,7 +504,7 @@ flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, /* Record our last path and construct our filename. */ - strlcpy(last, f->path, MAXPATHLEN); + strlcpy(last, f->path, PATH_MAX); f->wpath = f->path; return 1; } @@ -593,7 +593,7 @@ flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz) const struct flist *fflast = NULL; size_t flsz = 0, flmax = 0, lsz, gidsz = 0, uidsz = 0; uint8_t flag; - char last[MAXPATHLEN]; + char last[PATH_MAX]; int64_t lval; /* temporary values... */ int32_t ival; uint32_t uival; diff --git a/usr.bin/rsync/session.c b/usr.bin/rsync/session.c index d87e45cd238..0b430369529 100644 --- a/usr.bin/rsync/session.c +++ b/usr.bin/rsync/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.8 2021/06/30 13:10:04 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.9 2021/09/02 21:06:06 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -14,7 +14,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include diff --git a/usr.bin/rsync/symlinks.c b/usr.bin/rsync/symlinks.c index 18bdf8ddbf1..cc4527cdb7b 100644 --- a/usr.bin/rsync/symlinks.c +++ b/usr.bin/rsync/symlinks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: symlinks.c,v 1.6 2021/06/30 13:10:04 claudio Exp $ */ +/* $OpenBSD: symlinks.c,v 1.7 2021/09/02 21:06:06 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -14,11 +14,11 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include +#include #include #include "extern.h" @@ -36,7 +36,7 @@ symlink_read(const char *path) ssize_t nsz = 0; void *pp; - for (sz = MAXPATHLEN; ; sz *= 2) { + for (sz = PATH_MAX; ; sz *= 2) { if ((pp = realloc(buf, sz + 1)) == NULL) { ERR("realloc"); free(buf); @@ -75,7 +75,7 @@ symlinkat_read(int fd, const char *path) ssize_t nsz = 0; void *pp; - for (sz = MAXPATHLEN; ; sz *= 2) { + for (sz = PATH_MAX; ; sz *= 2) { if ((pp = realloc(buf, sz + 1)) == NULL) { ERR("realloc"); free(buf); -- 2.20.1