* [gentoo-commits] repo/gentoo:master commit in: x11-wm/openbox/files/, x11-wm/openbox/
@ 2023-03-09 16:29 Jimi Huotari
0 siblings, 0 replies; 2+ messages in thread
From: Jimi Huotari @ 2023-03-09 16:29 UTC (permalink / raw
To: gentoo-commits
commit: c7ad157920317e70d19389d9f3601d3cc7f599be
Author: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 9 14:22:09 2023 +0000
Commit: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
CommitDate: Thu Mar 9 16:29:48 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7ad1579
x11-wm/openbox: patch getgrent to getgroups
Upstream: https://bugzilla.icculus.org/show_bug.cgi?id=5978
Closes: https://bugs.gentoo.org/827227
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
.../openbox-3.6.1-getgrent-to-getgroups.patch | 67 ++++++++++++++++++++++
...openbox-9999.ebuild => openbox-3.6.1-r4.ebuild} | 4 +-
x11-wm/openbox/openbox-9999.ebuild | 4 +-
3 files changed, 73 insertions(+), 2 deletions(-)
diff --git a/x11-wm/openbox/files/openbox-3.6.1-getgrent-to-getgroups.patch b/x11-wm/openbox/files/openbox-3.6.1-getgrent-to-getgroups.patch
new file mode 100644
index 000000000000..4634b5a03028
--- /dev/null
+++ b/x11-wm/openbox/files/openbox-3.6.1-getgrent-to-getgroups.patch
@@ -0,0 +1,67 @@
+Gentoo: https://bugs.gentoo.org/827227
+Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808138
+Upstream: https://bugzilla.icculus.org/show_bug.cgi?id=5978
+
+>From e0cb404f53c9b21a521ea2f14c8cd66fdfb68ea7 Mon Sep 17 00:00:00 2001
+From: Simon <simondobbss@gmail.com>
+Date: Tue, 15 Dec 2015 15:46:18 +0100
+Subject: [PATCH] Replace getgrent with getgroups. Fixes #5978.
+
+---
+ obt/paths.c | 34 +++++++++++++++++++++-------------
+ 1 file changed, 21 insertions(+), 13 deletions(-)
+
+diff --git a/obt/paths.c b/obt/paths.c
+index 25cb6b0..d526936 100644
+--- a/obt/paths.c
++++ b/obt/paths.c
+@@ -108,25 +108,33 @@ static void find_uid_gid(uid_t *u, gid_t **g, guint *n)
+ const gchar *name;
+ struct group *gr;
+
++ gid_t gmain;
++ unsigned int maininc;
++ int i;
++
+ *u = getuid();
+ pw = getpwuid(*u);
+ name = pw->pw_name;
+
+- *g = g_new(gid_t, *n=1);
+- (*g)[0] = getgid();
+-
+- while ((gr = getgrent())) {
+- if (gr->gr_gid != (*g)[0]) { /* skip the main group */
+- gchar **c;
+- for (c = gr->gr_mem; *c; ++c)
+- if (strcmp(*c, name) == 0) {
+- *g = g_renew(gid_t, *g, ++(*n)); /* save the group */
+- (*g)[*n-1] = gr->gr_gid;
+- break;
+- }
++ gmain = getgid();
++
++ *n = getgroups(0, *g);
++ *g = g_new(gid_t, *n);
++ *n = getgroups(*n, *g);
++
++ /* Check if the effective group ID of the calling process is already
++ included in the returned list. Add it otherwise. */
++ maininc = 0;
++ for (i = 0; i < *n; i++) {
++ if ( (*g)[i] == gmain ) {
++ maininc = 1;
++ break;
+ }
+ }
+- endgrent();
++ if (!maininc) {
++ *g = g_renew(gid_t, *g, ++(*n));
++ (*g)[*n-1] = gmain;
++ }
+
+ qsort(*g, *n, sizeof(gid_t), gid_cmp);
+ }
+--
+2.1.4
+
diff --git a/x11-wm/openbox/openbox-9999.ebuild b/x11-wm/openbox/openbox-3.6.1-r4.ebuild
similarity index 95%
copy from x11-wm/openbox/openbox-9999.ebuild
copy to x11-wm/openbox/openbox-3.6.1-r4.ebuild
index 261d9e75d33f..e569dd1af6b1 100644
--- a/x11-wm/openbox/openbox-9999.ebuild
+++ b/x11-wm/openbox/openbox-3.6.1-r4.ebuild
@@ -14,7 +14,7 @@ if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
else
SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-linux"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x86-linux"
fi
SRC_URI+=" branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
@@ -59,6 +59,8 @@ PATCHES=(
"${FILESDIR}/${PN}-3.5.2-gnome-session.patch"
# see https://github.com/danakj/openbox/pull/35
"${FILESDIR}/${PN}-3.6.1-py3-xdg.patch"
+ # https://bugs.gentoo.org/827227
+ "${FILESDIR}/${PN}-3.6.1-getgrent-to-getgroups.patch"
)
pkg_setup() {
diff --git a/x11-wm/openbox/openbox-9999.ebuild b/x11-wm/openbox/openbox-9999.ebuild
index 261d9e75d33f..e569dd1af6b1 100644
--- a/x11-wm/openbox/openbox-9999.ebuild
+++ b/x11-wm/openbox/openbox-9999.ebuild
@@ -14,7 +14,7 @@ if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
else
SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-linux"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x86-linux"
fi
SRC_URI+=" branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
@@ -59,6 +59,8 @@ PATCHES=(
"${FILESDIR}/${PN}-3.5.2-gnome-session.patch"
# see https://github.com/danakj/openbox/pull/35
"${FILESDIR}/${PN}-3.6.1-py3-xdg.patch"
+ # https://bugs.gentoo.org/827227
+ "${FILESDIR}/${PN}-3.6.1-getgrent-to-getgroups.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: x11-wm/openbox/files/, x11-wm/openbox/
@ 2023-03-19 10:29 Jimi Huotari
0 siblings, 0 replies; 2+ messages in thread
From: Jimi Huotari @ 2023-03-19 10:29 UTC (permalink / raw
To: gentoo-commits
commit: 95d5a573165b47f9523ba43d9abc3cae5e116c48
Author: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 19 10:24:19 2023 +0000
Commit: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 10:24:19 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95d5a573
x11-wm/openbox: patch issue with >=glib-2.76.0
Bug: https://bugs.gentoo.org/901777
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
x11-wm/openbox/files/openbox-3.6.1-glib-2.76.patch | 54 +++++++++
x11-wm/openbox/openbox-3.6.1-r5.ebuild | 123 +++++++++++++++++++++
2 files changed, 177 insertions(+)
diff --git a/x11-wm/openbox/files/openbox-3.6.1-glib-2.76.patch b/x11-wm/openbox/files/openbox-3.6.1-glib-2.76.patch
new file mode 100644
index 000000000000..65d0dba17300
--- /dev/null
+++ b/x11-wm/openbox/files/openbox-3.6.1-glib-2.76.patch
@@ -0,0 +1,54 @@
+Gentoo Bug: https://bugs.gentoo.org/901777
+Upstream Bug: https://bugzilla.icculus.org/show_bug.cgi?id=6669
+Upstream Commit: https://github.com/Mikachu/openbox/commit/9ed6fdd71890c5cc43747f105382d5677e5d37e7
+
+From 9ed6fdd71890c5cc43747f105382d5677e5d37e7 Mon Sep 17 00:00:00 2001
+From: pldubouilh <pldubouilh@gmail.com>
+Date: Fri, 17 Mar 2023 18:23:47 +0100
+Subject: [PATCH] Fix list traversal issue in client_calc_layer
+
+The calls to client_calc_layer_internal can modify stacking_list, which
+can cause us to follow dangling ->next pointers (either by the pointer
+itself already being freed, or it pointing to a freed area). Avoid this
+by copying the list first, the goal is to visit every client in the list
+once so this should be fine.
+---
+ openbox/client.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/openbox/client.c b/openbox/client.c
+index 7168b2407..b8264587c 100644
+--- a/openbox/client.c
++++ b/openbox/client.c
+@@ -2742,9 +2742,12 @@ static void client_calc_layer_internal(ObClient *self)
+ void client_calc_layer(ObClient *self)
+ {
+ GList *it;
++ /* the client_calc_layer_internal calls below modify stacking_list,
++ so we have to make a copy to iterate over */
++ GList *list = g_list_copy(stacking_list);
+
+ /* skip over stuff above fullscreen layer */
+- for (it = stacking_list; it; it = g_list_next(it))
++ for (it = list; it; it = g_list_next(it))
+ if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
+
+ /* find the windows in the fullscreen layer, and mark them not-visited */
+@@ -2757,7 +2760,7 @@ void client_calc_layer(ObClient *self)
+ client_calc_layer_internal(self);
+
+ /* skip over stuff above fullscreen layer */
+- for (it = stacking_list; it; it = g_list_next(it))
++ for (it = list; it; it = g_list_next(it))
+ if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
+
+ /* now recalc any windows in the fullscreen layer which have not
+@@ -2768,6 +2771,8 @@ void client_calc_layer(ObClient *self)
+ !WINDOW_AS_CLIENT(it->data)->visited)
+ client_calc_layer_internal(it->data);
+ }
++
++ g_list_free(it);
+ }
+
+ gboolean client_should_show(ObClient *self)
diff --git a/x11-wm/openbox/openbox-3.6.1-r5.ebuild b/x11-wm/openbox/openbox-3.6.1-r5.ebuild
new file mode 100644
index 000000000000..ebd2a5d8b75d
--- /dev/null
+++ b/x11-wm/openbox/openbox-3.6.1-r5.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11})
+inherit autotools python-single-r1
+
+DESCRIPTION="Standards compliant, fast, light-weight, extensible window manager"
+HOMEPAGE="http://openbox.org/wiki/Main_Page"
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Mikachu/openbox.git"
+else
+ SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x86-linux"
+fi
+
+SRC_URI+=" branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="3"
+IUSE="branding debug imlib nls session startup-notification svg xdg"
+REQUIRED_USE="xdg? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+RDEPEND="
+ dev-libs/glib:2
+ >=dev-libs/libxml2-2.0
+ >=media-libs/fontconfig-2
+ x11-libs/cairo
+ x11-libs/libXau
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXft
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXt
+ >=x11-libs/pango-1.8[X]
+ imlib? ( media-libs/imlib2 )
+ startup-notification? ( >=x11-libs/startup-notification-0.8 )
+ svg? ( gnome-base/librsvg:2 )
+ xdg? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ ')
+ )
+"
+DEPEND="${RDEPEND}
+ x11-base/xorg-proto
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.5.2-gnome-session.patch"
+ # see https://github.com/danakj/openbox/pull/35
+ "${FILESDIR}/${PN}-3.6.1-py3-xdg.patch"
+ # https://bugs.gentoo.org/827227
+ "${FILESDIR}/${PN}-3.6.1-getgrent-to-getgroups.patch"
+ # https://bugs.gentoo.org/901777
+ "${FILESDIR}/${PN}-3.6.1-glib-2.76.patch"
+)
+
+pkg_setup() {
+ use xdg && python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ git-r3_src_unpack
+ fi
+
+ default
+}
+
+src_prepare() {
+ default
+ sed -i \
+ -e "s:-O0 -ggdb ::" \
+ -e 's/-fno-strict-aliasing//' \
+ m4/openbox.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --disable-static
+ --with-x
+ $(use_enable debug)
+ $(use_enable imlib imlib2)
+ $(use_enable nls)
+ $(use_enable session session-management)
+ $(use_enable startup-notification)
+ $(use_enable svg librsvg)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ dodir /etc/X11/Sessions
+ echo "/usr/bin/openbox-session" > "${ED}/etc/X11/Sessions/${PN}"
+ fperms a+x /etc/X11/Sessions/${PN}
+ emake DESTDIR="${D}" install
+ if use branding; then
+ insinto /usr/share/themes
+ doins -r "${WORKDIR}"/Surreal_Gentoo
+ # make it the default theme
+ sed -i \
+ -e "/<theme>/{n; s@<name>.*</name>@<name>Surreal_Gentoo</name>@}" \
+ "${D}"/etc/xdg/openbox/rc.xml \
+ || die "failed to set Surreal Gentoo as the default theme"
+ fi
+ find "${ED}" -name '*.la' -delete || die
+ if use xdg ; then
+ python_fix_shebang "${ED}"/usr/libexec/openbox-xdg-autostart
+ else
+ rm "${ED}"/usr/libexec/openbox-xdg-autostart || die
+ fi
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-19 10:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 10:29 [gentoo-commits] repo/gentoo:master commit in: x11-wm/openbox/files/, x11-wm/openbox/ Jimi Huotari
-- strict thread matches above, loose matches on Subject: below --
2023-03-09 16:29 Jimi Huotari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox