From nobody Tue Jul 28 09:34:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h8VfF3JYGz6mSNG for ; Tue, 28 Jul 2026 09:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h8VfF1Fs1z3VRd for ; Tue, 28 Jul 2026 09:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785231253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=19A5a4aXa8n/sKf6wu6HoGTELKCiYQkXfJLBrfkBI80=; b=H7IhbP9DLJg0GDJ8p1zM+6927a3TGvXr4mDp0YGUpQwx2GRrp0mtFDvyKC/I1H/fviBdlU 88ZZq4CyGsbdo6vefRw57h+sdtbN5U72bBwY1rOL15sgAZYA3FHU6Ta5nhpdNdgkLtKrqu aJf2M5wYY2vjrxNvpyvktMCP9uos4IyzOrHvjSl4kH4Hf0Zx29F3pt1c+9XVs/Xx2K2UyR T+VoELWo8UMA7FNJUXx47+x0MeSrIyMYfCMS7f6ZbvTo7GrSWlNDcd1zuyc7C021IVcMgN AuX4s5cPfota/VVhHsFirQJewStUYbVlzSisGgThm4Gxs8TgvxewWTWKttqYpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785231253; a=rsa-sha256; cv=none; b=Hdr6oMHVl8il8Qc4bi0J9/HlXxqGK8Tkjnfm8wXwiSLjqXEgmfA0eklFv3wvyWNzp5ZZX9 Ck5h0b31KLWjvAlA2aDXH5GJkfctLYEWzY0O/I8pKWccoiFcTK/zvWl29THezXl4LgDy2I AGVijLYnWKQ7IK+5+n1ppL61fnDnuvCZtHvI3OGAlgU4XTWqHd5lMYxFek/iOqx5XKZDOB hzRbBExgskyC26xhoq742ZaQSVTDrj8sVEeDbOhQaHcYGX7uI8UxDWf2OAPgpBsAL9HhMi jf0oTBdcVyGDlktMYN6PC41UOBNbn7o2cvxh59UjeCzSLIMbd5mTbJUdnveBjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785231253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=19A5a4aXa8n/sKf6wu6HoGTELKCiYQkXfJLBrfkBI80=; b=sbPMPwK6CJ3l0FUcKF/kS5uP5t3cEj9ZzXSCc5fJM8pdyXfpm3UILlmXLgsOiTX+8rkRi2 fRKxwjvNcoG08SLOrIYiaQFJr3CHYgOEr80prYmqRN5mWkBiEn9ifzWAsxEs3NMsGhnMar YWHtb8hA00dv5dk0AP0nwK3dOH7Zkx3eZwuLWosZicauofObUQLRCug7Oaz7eTk7w3bT0R F2IPNpoAfgi4oATtk4WVXaHFy/P4Y/M5PU7PD3+RsPSI9j58Q9NeKDKj9DcQoghIZNozOa RVUgJzIw5aZ3mI3KW+W6Ak87Kd2qP3wVCeCBuFHMIu9wru7GqM3CvMekbilMzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h8VfD6k26zZdK for ; Tue, 28 Jul 2026 09:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c676 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 28 Jul 2026 09:34:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Aleksandr Rybalko From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: baf4c5992c0a - stable/15 - install: drop obsolete file size limit for -C List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: baf4c5992c0a1021b8036afa5429374b5b62d878 Auto-Submitted: auto-generated Date: Tue, 28 Jul 2026 09:34:12 +0000 Message-Id: <6a687794.1c676.617bd917@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=baf4c5992c0a1021b8036afa5429374b5b62d878 commit baf4c5992c0a1021b8036afa5429374b5b62d878 Author: Aleksandr Rybalko AuthorDate: 2026-06-08 14:32:05 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-07-28 09:30:21 +0000 install: drop obsolete file size limit for -C Removes the file size limit for -C comparisons. The limit was meant to prevent oversized mmap allocations, which is no longer relevant as mmap is no longer used here (removed by a0439a1b820fa0e742c00d095f5f5c06f5f19432, review D44809). Credit to bdrewery. See: https://reviews.freebsd.org/D57230 Reviewed by: bdrewery, glebius, ziaee Approved by: glebius (mentor) Obtained from: Fudo Security MFC after: 2 weeks Sponsored by: Fudo Security Differential Revision: https://reviews.freebsd.org/D57503 (cherry picked from commit 9d10b4d2c9e86d8f6ff1b654f468381a4a4cad6d) --- usr.bin/xinstall/Makefile | 2 +- usr.bin/xinstall/install.1 | 13 +----- usr.bin/xinstall/xinstall.c | 103 +++++++++++++++++++------------------------- 3 files changed, 47 insertions(+), 71 deletions(-) diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile index c05a50420c82..fd95b97160fe 100644 --- a/usr.bin/xinstall/Makefile +++ b/usr.bin/xinstall/Makefile @@ -11,7 +11,7 @@ MAN= install.1 CFLAGS+= -I${SRCTOP}/contrib/mtree CFLAGS+= -I${SRCTOP}/lib/libnetbsd -LIBADD= md util +LIBADD= md CFLAGS+= -DWITH_MD5 -DWITH_RIPEMD160 .ifdef BOOTSTRAPPING diff --git a/usr.bin/xinstall/install.1 b/usr.bin/xinstall/install.1 index 77b928d022db..c6a55632891c 100644 --- a/usr.bin/xinstall/install.1 +++ b/usr.bin/xinstall/install.1 @@ -33,7 +33,7 @@ .Nd install binaries .Sh SYNOPSIS .Nm -.Op Fl bCcpSsUvz +.Op Fl bCcpSsUv .Op Fl B Ar suffix .Op Fl D Ar destdir .Op Fl f Ar flags @@ -45,10 +45,9 @@ .Op Fl N Ar dbdir .Op Fl o Ar owner .Op Fl T Ar tags -.Op Fl z Ar size .Ar file1 file2 .Nm -.Op Fl bCcpSsUvz +.Op Fl bCcpSsUv .Op Fl B Ar suffix .Op Fl D Ar destdir .Op Fl f Ar flags @@ -60,7 +59,6 @@ .Op Fl N Ar dbdir .Op Fl o Ar owner .Op Fl T Ar tags -.Op Fl z Ar size .Ar file1 ... fileN directory .Nm .Fl d @@ -273,13 +271,6 @@ Cause .Nm to be verbose, showing files as they are installed or backed up. -.It Fl z Ar maxsize -Limit the comparison feature of -.Fl C -to files no larger than -.Ar maxsize . -Files exceeding this limit bypass the comparison step and are directly overwritten. -The default maximum size is 128MiB. .El .Pp By default, diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index ddd85319a9e1..2c88e080bb74 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include "mtree.h" @@ -89,8 +88,6 @@ #define HAVE_STRUCT_STAT_ST_FLAGS 0 #endif -#define MAX_CMP_SIZE (128 * 1024 * 1024) - #define LN_ABSOLUTE 0x01 #define LN_RELATIVE 0x02 #define LN_HARD 0x04 @@ -139,7 +136,6 @@ static FILE *metafp; static const char *group, *owner; static const char *suffix = BACKUP_SUFFIX; static char *destdir, *digest, *fflags, *metafile, *tags; -static size_t max_compare_size = MAX_CMP_SIZE; static int compare(int, const char *, size_t, int, const char *, size_t, char **); @@ -171,13 +167,12 @@ main(int argc, char *argv[]) u_int iflags; char *p; const char *to_name; - uint64_t num; fset = 0; iflags = 0; set = NULL; group = owner = NULL; - while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uvz:")) != + while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != -1) switch((char)ch) { case 'B': @@ -274,13 +269,6 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; - case 'z': - if (expand_number(optarg, &num) != 0 || num == 0) { - errx(EX_USAGE, "invalid max compare filesize:" - " %s", optarg); - } - max_compare_size = num; - break; case '?': default: usage(); @@ -1100,8 +1088,11 @@ compare(int from_fd, const char *from_name __unused, size_t from_len, int to_fd, const char *to_name __unused, size_t to_len, char **dresp) { - int rv; + static char *buf, *buf1, *buf2; + static size_t bufsize; int do_digest; + int n1, n2; + int rv; DIGEST_CTX ctx; if (from_len != to_len) @@ -1109,53 +1100,47 @@ compare(int from_fd, const char *from_name __unused, size_t from_len, do_digest = (digesttype != DIGEST_NONE && dresp != NULL && *dresp == NULL); - if (from_len <= max_compare_size) { - static char *buf, *buf1, *buf2; - static size_t bufsize; - int n1, n2; - if (do_digest) - digest_init(&ctx); + if (do_digest) + digest_init(&ctx); - if (buf == NULL) { - /* - * Note that buf and bufsize are static. If - * malloc() fails, it will fail at the start - * and not copy only some files. - */ - if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) - bufsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); + if (buf == NULL) { + /* + * Note that buf and bufsize are static. If + * malloc() fails, it will fail at the start + * and not copy only some files. + */ + if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) + bufsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); + else + bufsize = BUFSIZE_SMALL; + buf = malloc(bufsize * 2); + if (buf == NULL) + err(1, "Not enough memory"); + buf1 = buf; + buf2 = buf + bufsize; + } + + rv = 0; + lseek(from_fd, 0, SEEK_SET); + lseek(to_fd, 0, SEEK_SET); + while (rv == 0) { + n1 = read(from_fd, buf1, bufsize); + if (n1 == 0) + break; /* EOF */ + else if (n1 > 0) { + n2 = read(to_fd, buf2, n1); + if (n2 == n1) + rv = memcmp(buf1, buf2, n1); else - bufsize = BUFSIZE_SMALL; - buf = malloc(bufsize * 2); - if (buf == NULL) - err(1, "Not enough memory"); - buf1 = buf; - buf2 = buf + bufsize; - } - rv = 0; - lseek(from_fd, 0, SEEK_SET); - lseek(to_fd, 0, SEEK_SET); - while (rv == 0) { - n1 = read(from_fd, buf1, bufsize); - if (n1 == 0) - break; /* EOF */ - else if (n1 > 0) { - n2 = read(to_fd, buf2, n1); - if (n2 == n1) - rv = memcmp(buf1, buf2, n1); - else - rv = 1; /* out of sync */ - } else - rv = 1; /* read failure */ - if (do_digest) - digest_update(&ctx, buf1, n1); - } - lseek(from_fd, 0, SEEK_SET); - lseek(to_fd, 0, SEEK_SET); - } else { - rv = 1; /* don't bother in this case */ + rv = 1; /* out of sync */ + } else + rv = 1; /* read failure */ + if (do_digest) + digest_update(&ctx, buf1, n1); } + lseek(from_fd, 0, SEEK_SET); + lseek(to_fd, 0, SEEK_SET); if (do_digest) { if (rv == 0) @@ -1501,11 +1486,11 @@ usage(void) { (void)fprintf(stderr, "usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]\n" -" [-M log] [-D dest] [-h hash] [-T tags] [-z maxcmpsize]\n" +" [-M log] [-D dest] [-h hash] [-T tags]\n" " [-B suffix] [-l linkflags] [-N dbdir]\n" " file1 file2\n" " install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]\n" -" [-M log] [-D dest] [-h hash] [-T tags] [-z maxcmpsize]\n" +" [-M log] [-D dest] [-h hash] [-T tags]\n" " [-B suffix] [-l linkflags] [-N dbdir]\n" " file1 ... fileN directory\n" " install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]\n"