From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 317F115800F for ; Wed, 4 Jan 2023 01:09:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 76324E0798; Wed, 4 Jan 2023 01:09:05 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 57D62E0798 for ; Wed, 4 Jan 2023 01:09:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 91963340E5B for ; Wed, 4 Jan 2023 01:09:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0364C7E8 for ; Wed, 4 Jan 2023 01:09:03 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1672794515.b7cdb9f1997d5123ad92ac9f17079b7e67e52f29.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/dpkg/files/, app-arch/dpkg/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-arch/dpkg/dpkg-1.21.15-r1.ebuild app-arch/dpkg/dpkg-1.21.15.ebuild app-arch/dpkg/files/dpkg-1.21.15-buf-lengh.patch app-arch/dpkg/files/dpkg-1.21.15-buf-overflow.patch X-VCS-Directories: app-arch/dpkg/ app-arch/dpkg/files/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: b7cdb9f1997d5123ad92ac9f17079b7e67e52f29 X-VCS-Branch: master Date: Wed, 4 Jan 2023 01:09:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c6303edf-509d-4eaf-aa10-3085ff7aacf3 X-Archives-Hash: d6df2c3d092e417695d65a2c1724eeeb commit: b7cdb9f1997d5123ad92ac9f17079b7e67e52f29 Author: Georgy Yakovlev gentoo org> AuthorDate: Wed Jan 4 01:08:02 2023 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Wed Jan 4 01:08:35 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7cdb9f1 app-arch/dpkg: replace buf patch with upstream fix in 1.21.15 Signed-off-by: Georgy Yakovlev gentoo.org> ...{dpkg-1.21.15.ebuild => dpkg-1.21.15-r1.ebuild} | 2 +- app-arch/dpkg/files/dpkg-1.21.15-buf-lengh.patch | 34 ---------------- .../dpkg/files/dpkg-1.21.15-buf-overflow.patch | 45 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 35 deletions(-) diff --git a/app-arch/dpkg/dpkg-1.21.15.ebuild b/app-arch/dpkg/dpkg-1.21.15-r1.ebuild similarity index 97% rename from app-arch/dpkg/dpkg-1.21.15.ebuild rename to app-arch/dpkg/dpkg-1.21.15-r1.ebuild index 02e4f4a95589..d26e233149be 100644 --- a/app-arch/dpkg/dpkg-1.21.15.ebuild +++ b/app-arch/dpkg/dpkg-1.21.15-r1.ebuild @@ -46,7 +46,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-1.18.12-flags.patch - "${FILESDIR}"/${PN}-1.21.15-buf-lengh.patch # sent upstream + "${FILESDIR}"/${P}-buf-overflow.patch ) src_prepare() { diff --git a/app-arch/dpkg/files/dpkg-1.21.15-buf-lengh.patch b/app-arch/dpkg/files/dpkg-1.21.15-buf-lengh.patch deleted file mode 100644 index 1ab28d1df5a0..000000000000 --- a/app-arch/dpkg/files/dpkg-1.21.15-buf-lengh.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7caf70b6cda200e1bad77c26e46e465a4ad76d71 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Mon, 2 Jan 2023 21:57:29 -0800 -Subject: [PATCH] dpkg-deb: increase buf lengh in movecontrolfiles - -In some cases limit of 200 is too short. -For example, on gentoo we build in /var/tmp/portage (user configurable) - -the buf contents end up exactly 201 characters: -e.g.: "mv /long/path /another/long/path && rmdir /yet/another/long/path" - -so we only catch it in testsuite and dpkg-deb tests fail sometimes. - -Signed-off-by: Georgy Yakovlev ---- - src/deb/extract.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/deb/extract.c b/src/deb/extract.c -index a098539..332c664 100644 ---- a/src/deb/extract.c -+++ b/src/deb/extract.c -@@ -53,7 +53,7 @@ - static void - movecontrolfiles(const char *dir, const char *thing) - { -- char buf[200]; -+ char buf[512]; - pid_t pid; - - sprintf(buf, "mv %s/%s/* %s/ && rmdir %s/%s", dir, thing, dir, dir, thing); --- -2.39.0 - diff --git a/app-arch/dpkg/files/dpkg-1.21.15-buf-overflow.patch b/app-arch/dpkg/files/dpkg-1.21.15-buf-overflow.patch new file mode 100644 index 000000000000..864d57b98a5c --- /dev/null +++ b/app-arch/dpkg/files/dpkg-1.21.15-buf-overflow.patch @@ -0,0 +1,45 @@ +From 5356621172d669d8f62e7e746a6c7a11345aec4e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 3 Jan 2023 23:29:05 +0100 +Subject: dpkg-deb: Fix buffer overflow on long directory names with old deb + formats + +The handling for deb 0.x formats that relocates files around once +extracted was using a buffer with a hardcoded size, not taking into +account the length of the directory which would overflow it. + +Switch to use a dynamically allocated buffer to handle any destination +directory length. + +Reported-by: Georgy Yakovlev +--- + src/deb/extract.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/deb/extract.c b/src/deb/extract.c +index a09853962..6466fa6f2 100644 +--- a/src/deb/extract.c ++++ b/src/deb/extract.c +@@ -53,15 +53,16 @@ + static void + movecontrolfiles(const char *dir, const char *thing) + { +- char buf[200]; ++ char *cmd; + pid_t pid; + +- sprintf(buf, "mv %s/%s/* %s/ && rmdir %s/%s", dir, thing, dir, dir, thing); ++ cmd = str_fmt("mv %s/%s/* %s/ && rmdir %s/%s", dir, thing, dir, dir, thing); + pid = subproc_fork(); + if (pid == 0) { +- command_shell(buf, _("shell command to move files")); ++ command_shell(cmd, _("shell command to move files")); + } + subproc_reap(pid, _("shell command to move files"), 0); ++ free(cmd); + } + + static void DPKG_ATTR_NORET +-- +cgit v1.2.3 +