From nobody Mon Jun 06 19:11:10 2022 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 58DAB1BEB91C; Mon, 6 Jun 2022 19:11:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LH34G48Hcz523p; Mon, 6 Jun 2022 19:11:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654542670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6NIKTbEaIPVGNWu6Q+QTGatWJgVimc8hVhReghQv6c=; b=Co40loMhvKz3vJVROhJuKNKMfrMbNvVRN+0w8+E5olU23eFkkdx8pZOeJ7+qLy6BIcn8dz 28xJwq1FO2qgozcxl8BeOVgglPxh++55Ucdq8+ydPlD4IJM8oYUpjTWnjAwMAozfx2u1uv jrtokFEsXIPTgxbd3xL83H+hbwjdIJoSl84i+mwAQwloG7KB70UrD0MBLlnQt+cQKrnPAw OPN6igf2nttqW0YXL8eYxqgy3+uqxYlkzcFESLjrAD6BAdr3EOabEa/PLAF8iWpBqk35Ny AHzQ/vf55uLnbXsWpv0Uz3usYmM0E80Jk6Y7Ie4XzVFaeKPBPH7VnV1n+IsEng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 187A040B9; Mon, 6 Jun 2022 19:11:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 256JBAR4060669; Mon, 6 Jun 2022 19:11:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 256JBAk1060668; Mon, 6 Jun 2022 19:11:10 GMT (envelope-from git) Date: Mon, 6 Jun 2022 19:11:10 GMT Message-Id: <202206061911.256JBAk1060668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 9feba5ab9023 - stable/11 - fetch: MFC: make -S argument accept values > 2GB 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 9feba5ab9023bac268f5f26fae1bc6d8ffbd49eb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654542670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6NIKTbEaIPVGNWu6Q+QTGatWJgVimc8hVhReghQv6c=; b=Z3jGRqo1bG5ejJQ2eFsN6aMLDjw1TdHyci/3ROg7i6Nno9vzZhUAdxkXnApGdAnA1lnJZc o2/HPFuKMoK60AsI4oUKGAF7yT+qVBxH1dezcLn3pRpNCJKV/oRl1AjIdjH1IQT5U9E4Jh wdBMhiohi71T4ekTB/ax7C0e2xOX3S/yL01vbENdOUUz7xeOv8621Mad6Rux85ZLc9RP95 PjmSGtHBa/fKJ8LX5kj8PvVvalFVg4wNo75w6enaInYKLaqcUIeBbs6gvtywn7Hj92eQ7y 2MHw3kqVSDVusxX9iWXPdE9BF32T6etfv6ImdUC/pGL2Rc+ITHo1RxqbZz5Jbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654542670; a=rsa-sha256; cv=none; b=BnISYdphImgMxLNxdgpce7SY2YVxNvdOX9Uc8tb/5rnS5zCS8P0+9bPOSPiYbqS6W0aV14 +zwdOQvo95Datvlj4GA3XDwsYLL4Sr7j8lykEocAOeTQHCoqyPHIeWUWDd8e6410HTtCcw UcmtrC+LKsK+ZjQpEd2rSCd3zylJ/ZJN5xqpWPWXgQOEPeBKW3ebUhnkjgthxE9DSl9uPx ZqDwOOPVTVtoyBODFgRGC0GZBHCzQMt5NRYdmqeNOFGzU0XUc6eNTqnzv23V3jm6ZipVVQ YCws4kpDRtbSNj3fKXpQ2fL4qx4+Z144HxcdZeRbV2L6DXnse1R5NhIaj+U1vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/11 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=9feba5ab9023bac268f5f26fae1bc6d8ffbd49eb commit 9feba5ab9023bac268f5f26fae1bc6d8ffbd49eb Author: Stefan Eßer AuthorDate: 2022-02-20 14:24:43 +0000 Commit: Eugene Grosbein CommitDate: 2022-06-06 19:10:43 +0000 fetch: MFC: make -S argument accept values > 2GB Use strtoll() to parse the argument of the -S option. FreeBSD has supported 64 bit file offsets for more than 25 years on all architectures and off_t is a 64 bit integer type for that reason. While strtol() returns a 64 bit value on 64 LP64 architectures, it is limit to 32 bit on e.g. i386. The strtoll() function returns a 64 but result on all supported architectures and therefore supports the possible file lengths and file offsets on 32 bit archtectures. Reported by: antoine (cherry picked from commit 32066c96fa00fc19c8355e1956ca5aa9ead37673) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 22f7a1d2950b..14195f841a69 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -989,7 +989,7 @@ main(int argc, char *argv[]) r_flag = 1; break; case 'S': - S_size = (off_t)strtol(optarg, &end, 10); + S_size = strtoll(optarg, &end, 10); if (*optarg == '\0' || *end != '\0') errx(1, "invalid size (%s)", optarg); break;