=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/flist.c,v retrieving revision 1.31.2.1 retrieving revision 1.32 diff -u -r1.31.2.1 -r1.32 --- src/usr.bin/rsync/flist.c 2021/11/09 13:41:24 1.31.2.1 +++ src/usr.bin/rsync/flist.c 2021/06/30 13:10:04 1.32 @@ -1,4 +1,4 @@ -/* $Id: flist.c,v 1.31.2.1 2021/11/09 13:41:24 benno Exp $ */ +/* $OpenBSD: flist.c,v 1.32 2021/06/30 13:10:04 claudio 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 @@ -283,7 +283,7 @@ if (sess->mplex_reads && io_read_check(fdin) && - !io_read_flush(sess, fdin)) { + !io_read_flush(sess, fdin)) { ERRX1("io_read_flush"); goto out; } @@ -356,7 +356,7 @@ /* Conditional part: devices & special files. */ if ((sess->opts->devices && (S_ISBLK(f->st.mode) || - S_ISCHR(f->st.mode))) || + S_ISCHR(f->st.mode))) || (sess->opts->specials && (S_ISFIFO(f->st.mode) || S_ISSOCK(f->st.mode)))) { if (!io_write_int(sess, fdout, f->st.rdev)) { @@ -428,7 +428,7 @@ */ static int flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, - char last[PATH_MAX]) + char last[MAXPATHLEN]) { uint8_t bval; size_t partial = 0; @@ -504,7 +504,7 @@ /* Record our last path and construct our filename. */ - strlcpy(last, f->path, PATH_MAX); + strlcpy(last, f->path, MAXPATHLEN); f->wpath = f->path; return 1; } @@ -593,7 +593,7 @@ const struct flist *fflast = NULL; size_t flsz = 0, flmax = 0, lsz, gidsz = 0, uidsz = 0; uint8_t flag; - char last[PATH_MAX]; + char last[MAXPATHLEN]; int64_t lval; /* temporary values... */ int32_t ival; uint32_t uival; @@ -694,7 +694,7 @@ /* Conditional part: devices & special files. */ if ((sess->opts->devices && (S_ISBLK(ff->st.mode) || - S_ISCHR(ff->st.mode))) || + S_ISCHR(ff->st.mode))) || (sess->opts->specials && (S_ISFIFO(ff->st.mode) || S_ISSOCK(ff->st.mode)))) { if (!(FLIST_RDEV_SAME & flag)) { @@ -823,11 +823,6 @@ ERR("%s: lstat", root); return 0; } else if (S_ISREG(st.st_mode)) { - /* filter files */ - if (rules_match(root, 0) == -1) { - WARNX("%s: skipping excluded file", root); - return 1; - } if (!flist_realloc(fl, sz, max)) { ERRX1("flist_realloc"); return 0; @@ -844,13 +839,7 @@ if (!sess->opts->preserve_links) { WARNX("%s: skipping symlink", root); return 1; - } - /* filter files */ - if (rules_match(root, 0) == -1) { - WARNX("%s: skipping excluded symlink", root); - return 1; - } - if (!flist_realloc(fl, sz, max)) { + } else if (!flist_realloc(fl, sz, max)) { ERRX1("flist_realloc"); return 0; } @@ -953,15 +942,6 @@ nxdev++; } - /* filter files */ - if (rules_match(ent->fts_path + stripdir, - (ent->fts_info == FTS_D)) == -1) { - WARNX("%s: skipping excluded file", - ent->fts_path + stripdir); - fts_set(fts, ent, FTS_SKIP); - continue; - } - /* Allocate a new file entry. */ if (!flist_realloc(fl, sz, max)) { @@ -992,7 +972,7 @@ /* Optionally copy link information. */ if (S_ISLNK(ent->fts_statp->st_mode)) { - f->link = symlink_read(ent->fts_accpath); + f->link = symlink_read(f->path); if (f->link == NULL) { ERRX1("symlink_read"); goto out; @@ -1093,11 +1073,6 @@ continue; } - /* filter files */ - if (rules_match(argv[i], S_ISDIR(st.st_mode)) == -1) { - WARNX("%s: skipping excluded file", argv[i]); - continue; - } f = &fl[flsz++]; assert(f != NULL); @@ -1320,16 +1295,6 @@ } if (!flag) continue; - } - - /* filter files on delete */ - /* TODO handle --delete-excluded */ - if (rules_match(ent->fts_path + stripdir, - (ent->fts_info == FTS_D)) == -1) { - WARNX("skip excluded file %s", - ent->fts_path + stripdir); - fts_set(fts, ent, FTS_SKIP); - continue; } /* Look up in hashtable. */