summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2022-03-31 12:23:53 -0400
committerMike Gilbert <floppym@gentoo.org>2022-03-31 12:24:38 -0400
commit327024d4f4606f13c70655d4b67d8b03c447b23f (patch)
treec2aaed0d35390a26fbedbd8d49ff90371f814d5f /sys-apps/dbus
parentwww-client/opera-beta: remove old (diff)
downloadgentoo-327024d4f4606f13c70655d4b67d8b03c447b23f.tar.gz
gentoo-327024d4f4606f13c70655d4b67d8b03c447b23f.tar.bz2
gentoo-327024d4f4606f13c70655d4b67d8b03c447b23f.zip
sys-apps/dbus: backport fix for _dbus_reset_oom_score_adj
Closes: https://bugs.gentoo.org/834725 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-apps/dbus')
-rw-r--r--sys-apps/dbus/dbus-1.12.22.ebuild6
-rw-r--r--sys-apps/dbus/dbus-1.14.0.ebuild7
-rw-r--r--sys-apps/dbus/files/dbus-1.12.22-check-fd.patch33
3 files changed, 41 insertions, 5 deletions
diff --git a/sys-apps/dbus/dbus-1.12.22.ebuild b/sys-apps/dbus/dbus-1.12.22.ebuild
index 7427d268d82c..1caf4c88cc06 100644
--- a/sys-apps/dbus/dbus-1.12.22.ebuild
+++ b/sys-apps/dbus/dbus-1.12.22.ebuild
@@ -60,8 +60,10 @@ DOC_CONTENTS="
TBD="${WORKDIR}/${P}-tests-build"
PATCHES=(
- "${FILESDIR}/${PN}-enable-elogind.patch"
- "${FILESDIR}/${PN}-daemon-optional.patch" # bug #653136
+ "${FILESDIR}/dbus-enable-elogind.patch"
+ "${FILESDIR}/dbus-daemon-optional.patch" # bug #653136
+
+ "${FILESDIR}/dbus-1.12.22-check-fd.patch"
)
pkg_setup() {
diff --git a/sys-apps/dbus/dbus-1.14.0.ebuild b/sys-apps/dbus/dbus-1.14.0.ebuild
index 03e772f142c6..fa70a989b3d6 100644
--- a/sys-apps/dbus/dbus-1.14.0.ebuild
+++ b/sys-apps/dbus/dbus-1.14.0.ebuild
@@ -63,10 +63,11 @@ DOC_CONTENTS="
TBD="${WORKDIR}/${P}-tests-build"
PATCHES=(
- "${FILESDIR}/${PN}-enable-elogind.patch"
- "${FILESDIR}/${PN}-daemon-optional.patch" # bug #653136
+ "${FILESDIR}/dbus-enable-elogind.patch"
+ "${FILESDIR}/dbus-daemon-optional.patch" # bug #653136
- "${FILESDIR}/${P}-x-autoconf-fixes.patch"
+ "${FILESDIR}/dbus-1.14.0-x-autoconf-fixes.patch"
+ "${FILESDIR}/dbus-1.12.22-check-fd.patch"
)
pkg_setup() {
diff --git a/sys-apps/dbus/files/dbus-1.12.22-check-fd.patch b/sys-apps/dbus/files/dbus-1.12.22-check-fd.patch
new file mode 100644
index 000000000000..9038411bb13b
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.12.22-check-fd.patch
@@ -0,0 +1,33 @@
+From 769a0462befb9829594a76e675526aba8579317e Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sun, 27 Mar 2022 15:09:48 -0400
+Subject: [PATCH] sysdeps-unix: check fd before calling
+ _dbus_fd_set_close_on_exec()
+
+If /proc/self/oom_score_adj does not exist, fd will invalid (-1).
+Attempting to set the CLOEXEC flag will obviously fail, and we lose the
+original errno value from open().
+
+Bug: https://bugs.gentoo.org/834725
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ dbus/dbus-sysdeps-util-unix.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
+index 314ce64b..8f079cbf 100644
+--- a/dbus/dbus-sysdeps-util-unix.c
++++ b/dbus/dbus-sysdeps-util-unix.c
+@@ -1633,7 +1633,8 @@ _dbus_reset_oom_score_adj (const char **error_str_p)
+ if (fd < 0)
+ {
+ fd = open ("/proc/self/oom_score_adj", O_RDWR);
+- _dbus_fd_set_close_on_exec (fd);
++ if (fd >= 0)
++ _dbus_fd_set_close_on_exec (fd);
+ }
+
+ if (fd >= 0)
+--
+GitLab
+