=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/uploader.c,v retrieving revision 1.29.2.1 retrieving revision 1.30 diff -c -r1.29.2.1 -r1.30 *** src/usr.bin/rsync/uploader.c 2021/11/09 13:40:41 1.29.2.1 --- src/usr.bin/rsync/uploader.c 2021/10/22 11:10:34 1.30 *************** *** 1,4 **** ! /* $OpenBSD: uploader.c,v 1.29.2.1 2021/11/09 13:40:41 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser --- 1,4 ---- ! /* $OpenBSD: uploader.c,v 1.30 2021/10/22 11:10:34 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser *************** *** 653,659 **** */ static int check_file(int rootfd, const struct flist *f, struct stat *st) ! { if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) { if (errno == ENOENT) return 3; --- 653,659 ---- */ static int check_file(int rootfd, const struct flist *f, struct stat *st) ! { if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) { if (errno == ENOENT) return 3; *************** *** 704,718 **** return 0; } - if (sess->opts->max_size >= 0 && f->st.size > sess->opts->max_size) { - WARNX("skipping over max-size file %s", f->path); - return 0; - } - if (sess->opts->min_size >= 0 && f->st.size < sess->opts->min_size) { - WARNX("skipping under min-size file %s", f->path); - return 0; - } - /* * For non dry-run cases, we'll write the acknowledgement later * in the rsync_uploader() function. --- 704,709 ---- *************** *** 745,751 **** const char *root = sess->opts->basedir[i]; int dfd, x; ! dfd = openat(p->rootfd, root, O_RDONLY | O_DIRECTORY); if (dfd == -1) err(ERR_FILE_IO, "%s: openat", root); x = check_file(dfd, f, &st); --- 736,742 ---- const char *root = sess->opts->basedir[i]; int dfd, x; ! dfd = openat(p->rootfd, root, O_RDONLY | O_DIRECTORY, 0); if (dfd == -1) err(ERR_FILE_IO, "%s: openat", root); x = check_file(dfd, f, &st); *************** *** 780,786 **** } *size = st.st_size; ! *filefd = openat(p->rootfd, f->path, O_RDONLY | O_NOFOLLOW); if (*filefd == -1 && errno != ENOENT) { ERR("%s: openat", f->path); return -1; --- 771,777 ---- } *size = st.st_size; ! *filefd = openat(p->rootfd, f->path, O_RDONLY | O_NOFOLLOW, 0); if (*filefd == -1 && errno != ENOENT) { ERR("%s: openat", f->path); return -1; *************** *** 1035,1048 **** /* Make sure the block metadata buffer is big enough. */ u->bufsz = ! sizeof(int32_t) + /* identifier */ ! sizeof(int32_t) + /* block count */ ! sizeof(int32_t) + /* block length */ ! sizeof(int32_t) + /* checksum length */ ! sizeof(int32_t) + /* block remainder */ ! blk.blksz * ! (sizeof(int32_t) + /* short checksum */ ! blk.csum); /* long checksum */ if (u->bufsz > u->bufmax) { if ((bufp = realloc(u->buf, u->bufsz)) == NULL) { --- 1026,1039 ---- /* Make sure the block metadata buffer is big enough. */ u->bufsz = ! sizeof(int32_t) + /* identifier */ ! sizeof(int32_t) + /* block count */ ! sizeof(int32_t) + /* block length */ ! sizeof(int32_t) + /* checksum length */ ! sizeof(int32_t) + /* block remainder */ ! blk.blksz * ! (sizeof(int32_t) + /* short checksum */ ! blk.csum); /* long checksum */ if (u->bufsz > u->bufmax) { if ((bufp = realloc(u->buf, u->bufsz)) == NULL) {