Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

9 changed files with 72 additions and 114 deletions

View File

@ -1,28 +0,0 @@
From 30ff6e00e9a5edc15ff438b6cfd8a5a4169630a1 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 16 Jun 2025 14:49:55 +0200
Subject: [PATCH] Xm/String: Fix memory leak
ComputeMetrics() would leak the string created by _XmUtf8ToUcs2(), make
sure to free the string once done with it.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
lib/Xm/XmString.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Xm/XmString.c b/lib/Xm/XmString.c
index 2c54ef57..6ee1c40e 100644
--- a/lib/Xm/XmString.c
+++ b/lib/Xm/XmString.c
@@ -6272,6 +6272,7 @@ ComputeMetrics(XmRendition rend,
XTextExtents16(font_struct, str, str_len,
&dir, &asc, &desc, &char_ret);
+ XFree(str);
} else
XTextExtents16(font_struct,
(XChar2b *)text, Half(byte_count),
--
2.50.0

View File

@ -1,4 +1,4 @@
From 3a164564cf8241ee4544ff012659e8eb510b195b Mon Sep 17 00:00:00 2001
From 49791ea9aa84c64af114f564d4c46228263d1439 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 19 Nov 2024 18:40:33 +0100
Subject: [PATCH 1/7] build: Check for Xinerama availability
@ -57,5 +57,5 @@ index a95fa2db..07b733f5 100644
noinst_HEADERS = BaseClassI.h \
BitmapsI.h \
--
2.49.0
2.47.1

View File

@ -1,4 +1,4 @@
From f8aa9901f3cfa5fb49b809fdb223798623bede63 Mon Sep 17 00:00:00 2001
From 011e62e69fb87e78a128487a043cc13b042bb8b5 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 20 Nov 2024 10:26:28 +0100
Subject: [PATCH 2/7] Xm/Display: Add optional Xinerama support
@ -415,5 +415,5 @@ index 8c0c4f9a..5887e7ad 100644
#file XmStrDefsI.h
#table _XmStringsI
--
2.49.0
2.47.1

View File

@ -1,19 +1,15 @@
From 5fbc1dff0e2e248d61e43c362606c3f5e5255f7d Mon Sep 17 00:00:00 2001
From 10168aa7f16afb32e71d9e0a22fa8f90fb301bf4 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 21 Nov 2024 11:52:22 +0100
Subject: [PATCH 3/7] Xm/MenuShell: Use Xinerama to place menus
v2: If we have a pulldown button, use the location of that button to
keep the menu on the same monitor as that button so that the menu
doesn't eventually end up on another monitor entirely.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
lib/Xm/MenuShell.c | 47 +++++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 17 deletions(-)
lib/Xm/MenuShell.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/Xm/MenuShell.c b/lib/Xm/MenuShell.c
index 483cc95a..c78bfb08 100644
index 483cc95a..1dea4a54 100644
--- a/lib/Xm/MenuShell.c
+++ b/lib/Xm/MenuShell.c
@@ -41,6 +41,7 @@ static char rcsid[] = "$TOG: MenuShell.c /main/24 1999/07/08 16:49:59 vipin $"
@ -24,39 +20,26 @@ index 483cc95a..c78bfb08 100644
#include <Xm/SpecRenderT.h>
#include <Xm/TraitP.h>
#include <Xm/TransltnsP.h>
@@ -913,7 +914,9 @@ ForceMenuPaneOnScreen(
@@ -913,7 +914,7 @@ ForceMenuPaneOnScreen(
register Position *y )
{
Position rightEdgeOfMenu, bottomEdgeOfMenu;
- Dimension dispWidth, dispHeight;
+ Position dispX, dispY, dispMaxX, dispMaxY;
+ Position x1 = *x;
+ Position y1 = *y;
Widget pulldown_button = RC_CascadeBtn(rowcol);
Dimension RowColBorderWidth = rowcol->core.border_width << 1;
Dimension CascadeBorderWidth = 0;
@@ -925,8 +928,18 @@ ForceMenuPaneOnScreen(
@@ -925,8 +926,7 @@ ForceMenuPaneOnScreen(
rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width;
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
- dispWidth = WidthOfScreen (XtScreen(rowcol));
- dispHeight = HeightOfScreen (XtScreen(rowcol));
+#ifdef HAVE_LIBXINERAMA
+ if (pulldown_button)
+ {
+ /* If we have a pulldown button, use the location of that button to
+ * keep the menu on the same monitor as that button so that the menu
+ * doesn't eventually end up on another monitor entirely.
+ */
+ XtTranslateCoords((Widget) pulldown_button,
+ XtX(pulldown_button), XtY(pulldown_button), &x1, &y1);
+ }
+#endif
+ _XmScreenGetBoundariesAtpoint(XtScreen(rowcol), x1, y1, &dispX, &dispY, &dispMaxX, &dispMaxY);
+ _XmScreenGetBoundariesAtpoint(XtScreen(rowcol), *x, *y, &dispX, &dispY, &dispMaxX, &dispMaxY);
/*
* For OPTION menus, if the submenu is [partially] offscreen, offset it
@@ -937,9 +950,9 @@ ForceMenuPaneOnScreen(
@@ -937,9 +937,9 @@ ForceMenuPaneOnScreen(
(RC_Type(XtParent(pulldown_button)) == XmMENU_OPTION))
{
Position old_x = *x;
@ -68,7 +51,7 @@ index 483cc95a..c78bfb08 100644
if (LayoutIsRtoLM(rowcol))
*x = old_x - rowcol->core.width - (rowcol->core.border_width <<1);
else
@@ -948,9 +961,9 @@ ForceMenuPaneOnScreen(
@@ -948,9 +948,9 @@ ForceMenuPaneOnScreen(
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
}
@ -80,7 +63,7 @@ index 483cc95a..c78bfb08 100644
/* Consider CascadeBtn as well as RowCol width to allow multi
* column RowColumn
@@ -963,13 +976,13 @@ ForceMenuPaneOnScreen(
@@ -963,13 +963,13 @@ ForceMenuPaneOnScreen(
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
}
@ -96,7 +79,7 @@ index 483cc95a..c78bfb08 100644
{
if (LayoutIsRtoLM(rowcol))
*x = old_x + pulldown_button->core.width + CascadeBorderWidth;
@@ -982,10 +995,10 @@ ForceMenuPaneOnScreen(
@@ -982,10 +982,10 @@ ForceMenuPaneOnScreen(
/*
* If the submenu is offscreen force it completely on.
*/
@ -110,7 +93,7 @@ index 483cc95a..c78bfb08 100644
{
if (pulldown_button && XtParent(pulldown_button) &&
(RC_Type(XtParent(pulldown_button)) == XmMENU_BAR))
@@ -1005,15 +1018,15 @@ ForceMenuPaneOnScreen(
@@ -1005,15 +1005,15 @@ ForceMenuPaneOnScreen(
*y = y_temp;
}
else
@ -132,5 +115,5 @@ index 483cc95a..c78bfb08 100644
/*
--
2.49.0
2.47.1

View File

@ -1,4 +1,4 @@
From 0e834a8d37dfabd8fa4463f83c132478e50f8337 Mon Sep 17 00:00:00 2001
From e21e7ffaa62df64be305326d24eca09c80129403 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 21 Nov 2024 14:11:11 +0100
Subject: [PATCH 4/7] Xm/DropDown: Use Xinerama for placement
@ -61,5 +61,5 @@ index a25d1092..665e0e26 100644
XtSetArg(args[num_args], XmNx, x); num_args++;
XtSetArg(args[num_args], XmNy, y); num_args++;
--
2.49.0
2.47.1

View File

@ -1,4 +1,4 @@
From 3ef8c038b06f136a6abe7cfa23afec4d514af4f0 Mon Sep 17 00:00:00 2001
From d97abbe6cf64a8bb0e331725c36caf5e0ac37b0f Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 21 Nov 2024 14:17:21 +0100
Subject: [PATCH 5/7] Xm/RCMenu: Use Xinerama for placement
@ -66,5 +66,5 @@ index 2c698d4f..abd7a70e 100644
}
--
2.49.0
2.47.1

View File

@ -1,4 +1,4 @@
From f2bc91c789ed33fc1e0a31d167a6a7bc0383429e Mon Sep 17 00:00:00 2001
From af453aebd8e53a32369c792cf8d0e641b2b3a834 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 21 Nov 2024 14:24:30 +0100
Subject: [PATCH 6/7] Xm/Tooltip: Use Xinerama for placement
@ -49,5 +49,5 @@ index dc65071d..fdd32221 100644
destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y - geo.height;
}
--
2.49.0
2.47.1

View File

@ -1,4 +1,4 @@
From eb193dce2b7f8ce80004d14ccf64c53552ae103c Mon Sep 17 00:00:00 2001
From 8a026c2d1e94ab2a33a1bec55d703b229ce9daf7 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 21 Nov 2024 14:30:23 +0100
Subject: [PATCH 7/7] Xm/ComboBox: Use Xinerama for placement
@ -47,5 +47,5 @@ index 1472e458..0f49de50 100644
/* CR 8446: The shell width may have changed unexpectedly. */
shell_width = XtWidth(cb) - 2 * CB_HighlightThickness(cb);
--
2.49.0
2.47.1

View File

@ -1,9 +1,8 @@
Summary: Run-time libraries and programs
Name: motif
Version: 2.3.4
Release: 23%{?dist}
Release: 29%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz
Source1: xmbind
URL: http://www.motifzone.net/
@ -12,6 +11,7 @@ Provides: openmotif = %{version}-%{release}
Requires: xorg-x11-xbitmaps
Requires: xorg-x11-xinit
BuildRequires: make
BuildRequires: automake, libtool, autoconf, flex
# flex static libs have been part of flex for RHEL <= 6 and Fedora <= 12
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
@ -30,9 +30,6 @@ Patch43: openMotif-2.3.0-rgbtxt.patch
Patch45: motif-2.3.4-mwmrc_dir.patch
Patch46: motif-2.3.4-bindings.patch
Patch47: openMotif-2.3.0-no_X11R6.patch
# FTBFS #1448819
Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch
Patch49: openmotif-2.3.1-rhbz_997241.patch
Patch50: motif-2.3.5-motifzone_1654.patch
Patch51: motif-2.3.4-motifzone_1564-88bdce1.patch
@ -40,13 +37,17 @@ Patch52: revert-of-motifzone_1565.patch
Patch53: motifzone_1660.patch
Patch54: motifzone_1612.patch
# FTBFS #1448819
Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch
# rhbz#2125560
Patch55: 0001-EditresCom-Fix-build-with-modern-systems.patch
# CVE-2023-43788
Patch56: 0001-Fix-CVE-2023-43788-Out-of-bounds-read-in-XpmCreateXp.patch
# CVE-2023-43789
Patch57: 0001-Fix-CVE-2023-43789-Out-of-bounds-read-on-XPM-with-co.patch
# https://issues.redhat.com/browse/RHEL-67987
# https://issues.redhat.com/browse/RHEL-69956
Patch58: 0001-build-Check-for-Xinerama-availability.patch
Patch59: 0002-Xm-Display-Add-optional-Xinerama-support.patch
Patch60: 0003-Xm-MenuShell-Use-Xinerama-to-place-menus.patch
@ -55,8 +56,6 @@ Patch62: 0005-Xm-RCMenu-Use-Xinerama-for-placement.patch
Patch63: 0006-Xm-Tooltip-Use-Xinerama-for-placement.patch
Patch64: 0007-Xm-ComboBox-Use-Xinerama-for-placement.patch
# https://issues.redhat.com/browse/RHEL-96948
Patch65: 0001-Xm-String-Fix-memory-leak.patch
Conflicts: lesstif <= 0.92.32-6
@ -67,7 +66,6 @@ linked against Motif and the Motif Window Manager mwm.
%package devel
Summary: Development libraries and header files
Group: Development/Libraries
Conflicts: lesstif-devel <= 0.92.32-6
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libjpeg-devel%{?_isa} libpng-devel%{?_isa}
@ -82,7 +80,6 @@ header files and also static libraries necessary to build Motif applications.
%package static
Summary: Static libraries
Group: Development/Libraries
Conflicts: lesstif-devel <= 0.92.32-6
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
@ -98,7 +95,6 @@ This package contains the static Motif libraries.
%patch46 -p1 -b .bindings
%patch47 -p1 -b .no_X11R6
%patch48 -p1 -b .format-security
%patch49 -p1 -b .rhbz_997241
%patch50 -p1 -b .motifzone_1654
%patch51 -p1 -b .motifzone_1564-88bdce1
@ -115,15 +111,10 @@ This package contains the static Motif libraries.
%patch62 -p1 -b .xinerama
%patch63 -p1 -b .xinerama
%patch64 -p1 -b .xinerama
%patch65 -p1 -b .memleak
%build
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" \
./autogen.sh --libdir=%{_libdir} --enable-static --enable-xft --enable-jpeg \
--enable-png
%configure --libdir=%{_libdir} --enable-static --enable-xft --enable-jpeg \
--enable-png
./autogen.sh
%configure --enable-static --enable-xft --enable-jpeg --enable-png
make clean %{?_smp_mflags}
make -C include
@ -137,11 +128,7 @@ install -m 755 %{SOURCE1} %{buildroot}/etc/X11/xinit/xinitrc.d/xmbind.sh
rm -f %{buildroot}%{_libdir}/*.la
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf %{buildroot}
%ldconfig_scriptlets
%files
%doc COPYING README RELEASE RELNOTES
@ -173,34 +160,50 @@ rm -rf %{buildroot}
%{_libdir}/lib*.a
%changelog
* Fri Jun 27 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-23
- Fix a memory leak with UTF-8 strings
Resolves: RHEL-96948
* Mon Nov 25 2024 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-29
- Add Xinerama support (RHEL-69956)
* Mon Jun 2 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-22
- Keep drop-down menus on the same monitor as the pull-down button with
Xinerama
Resolves: RHEL-91951
* Mon Nov 25 2024 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-21
- Add Xinerama support (RHEL-67987)
* Mon Nov 27 2023 José Expósito <jexposit@redhat.com> - 2.3.4-20
* Mon Nov 27 2023 José Expósito <jexposit@redhat.com> - 2.3.4-28
- Fix CVE-2023-43788: out of bounds read in XpmCreateXpmImageFromBuffer()
- Fix CVE-2023-43789: out of bounds read on XPM with corrupted colormap
* Mon Sep 26 2022 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-19
- Fix LONG_BIT definition missing (rhbz#2124810)
* Mon Sep 26 2022 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-27
- Fix LONG_BIT definition missing (rhbz#2125560)
* Wed Sep 07 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-18
- Version bump
* Thu May 12 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-26
- Added patches from rhel-7
* Fri Apr 08 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-17
- Added forgotten patches and corrected release number
* Thu Feb 03 2022 Adam Jackson <ajax@redhat.com> - 2.3.4-25
- Fix invoking autogen/configure so the default CFLAGS actually get applied
Resolves: rhbz#2044881
* Tue Sep 11 2018 Carlos Soriano <csoriano@redhat.com> - 2.3.4-16
- Fix hardened flags, make sure to always pass LDFLAGS on the spec
- Resolves: RHBZ#1624143
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.3.4-24
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.3.4-23
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild