* [gentoo-commits] repo/gentoo:master commit in: dev-util/schroot/files/, dev-util/schroot/
@ 2023-01-15 3:59 Georgy Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2023-01-15 3:59 UTC (permalink / raw
To: gentoo-commits
commit: d69385cd24a131899918f7d51f8350a30564e983
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 03:56:10 2023 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 03:59:03 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d69385cd
dev-util/schroot: add resize -> reserve patch
otherwise it fails at runtime on hardened systems.
Thanks-to: Arsen Arsenović <arsen <AT> aarsen.me>
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../files/schroot-1.6.13-resize-reserve.patch | 103 +++++++++++++++++++++
....6.13_p2.ebuild => schroot-1.6.13_p2-r1.ebuild} | 5 +-
2 files changed, 107 insertions(+), 1 deletion(-)
diff --git a/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch b/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch
new file mode 100644
index 000000000000..da798f3b4761
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch
@@ -0,0 +1,103 @@
+From 6d7a762d6d630548ed558e0de8ddf04f3b0a69fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
+Date: Sat, 14 Jan 2023 22:53:20 +0100
+Subject: [PATCH] sbuild-util: use resize instead of reserve
+
+Using reserved but uninitialized space is invalid, and, additionally,
+reserve is not required to allocate memory or change the buffer size at
+all.
+---
+ sbuild/sbuild-util.cc | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/sbuild/sbuild-util.cc b/sbuild/sbuild-util.cc
+index b89068a7..b6af7e89 100644
+--- a/sbuild/sbuild-util.cc
++++ b/sbuild/sbuild-util.cc
+@@ -624,17 +624,17 @@ void
+ sbuild::passwd::query_uid (uid_t uid)
+ {
+ buffer_type::size_type size = 1 << 7;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::passwd *pwd_result;
+
+ while ((error = getpwuid_r(uid, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &pwd_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (pwd_result)
+@@ -647,17 +647,17 @@ void
+ sbuild::passwd::query_name (const char *name)
+ {
+ buffer_type::size_type size = 1 << 8;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::passwd *pwd_result;
+
+ while ((error = getpwnam_r(name, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &pwd_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (pwd_result)
+@@ -733,17 +733,17 @@ void
+ sbuild::group::query_gid (gid_t gid)
+ {
+ buffer_type::size_type size = 1 << 7;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::group *grp_result;
+
+ while ((error = getgrgid_r(gid, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &grp_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (grp_result)
+@@ -756,17 +756,17 @@ void
+ sbuild::group::query_name (const char *name)
+ {
+ buffer_type::size_type size = 1 << 8;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::group *grp_result;
+
+ while ((error = getgrnam_r(name, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &grp_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (grp_result)
+--
+2.30.2
+
diff --git a/dev-util/schroot/schroot-1.6.13_p2.ebuild b/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
similarity index 96%
rename from dev-util/schroot/schroot-1.6.13_p2.ebuild
rename to dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
index dedc047eec42..839f9adc48f4 100644
--- a/dev-util/schroot/schroot-1.6.13_p2.ebuild
+++ b/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -50,6 +50,9 @@ S="${WORKDIR}/re${PN}"
PATCHES=(
"${FILESDIR}"/${PN}-1.6.13_p2-build-fixes.patch
+
+ # https://codeberg.org/shelter/reschroot/pulls/6
+ "${FILESDIR}"/${PN}-1.6.13-resize-reserve.patch
)
src_unpack() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/schroot/files/, dev-util/schroot/
@ 2024-04-23 12:42 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-04-23 12:42 UTC (permalink / raw
To: gentoo-commits
commit: 3adaac9a6baaea72b2d82afec290967f0f422a94
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 23 11:16:39 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 23 12:41:44 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3adaac9a
dev-util/schroot: fix build w/ boost-1.85.0
I haven't sent a PR upstream as our last few are rotting.
Closes: https://bugs.gentoo.org/930499
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/schroot-1.16.13_p2-boost-1.85.0.patch | 32 ++++++++++++++++++++++
dev-util/schroot/schroot-1.6.13_p2-r1.ebuild | 2 ++
2 files changed, 34 insertions(+)
diff --git a/dev-util/schroot/files/schroot-1.16.13_p2-boost-1.85.0.patch b/dev-util/schroot/files/schroot-1.16.13_p2-boost-1.85.0.patch
new file mode 100644
index 000000000000..ba3c10edc104
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.16.13_p2-boost-1.85.0.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/930499
+--- a/sbuild/sbuild-chroot-config.cc
++++ b/sbuild/sbuild-chroot-config.cc
+@@ -31,6 +31,7 @@
+ #include <cstdlib>
+ #include <cstring>
+
++#include <boost/filesystem/directory.hpp>
+ #include <boost/filesystem/operations.hpp>
+
+ #include <sys/types.h>
+--- a/sbuild/sbuild-run-parts.cc
++++ b/sbuild/sbuild-run-parts.cc
+@@ -29,6 +29,7 @@
+ #include <syslog.h>
+
+ #include <boost/format.hpp>
++#include <boost/filesystem/directory.hpp>
+ #include <boost/filesystem/operations.hpp>
+
+ using boost::format;
+--- a/sbuild/sbuild-util.cc
++++ b/sbuild/sbuild-util.cc
+@@ -35,8 +35,6 @@
+ #include <time.h>
+ #endif
+
+-#include <boost/filesystem/convenience.hpp>
+-
+ using namespace sbuild;
+
+ namespace
diff --git a/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild b/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
index c287d0c0414d..d4c606a396ec 100644
--- a/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
+++ b/dev-util/schroot/schroot-1.6.13_p2-r1.ebuild
@@ -53,6 +53,8 @@ PATCHES=(
# https://codeberg.org/shelter/reschroot/pulls/6
"${FILESDIR}"/${PN}-1.6.13-resize-reserve.patch
+
+ "${FILESDIR}"/${PN}-1.16.13_p2-boost-1.85.0.patch
)
src_unpack() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-23 12:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 12:42 [gentoo-commits] repo/gentoo:master commit in: dev-util/schroot/files/, dev-util/schroot/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-01-15 3:59 Georgy Yakovlev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox