utils/gather-topology: fix a grep warning when matching octal sequence

Resolves: RHEL-107056
This commit is contained in:
Krzysztof Pawlinski 2025-10-21 12:48:09 +02:00
parent ba8b876d44
commit 4e71350bfc
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,41 @@
From f963e849e67062ad80b76919ba2c2a980ad8bf72 Mon Sep 17 00:00:00 2001
From: Brice Goglin <Brice.Goglin@inria.fr>
Date: Wed, 20 Aug 2025 10:34:19 +0200
Subject: [PATCH] utils/gather-topology: fix a grep warning when matching octal
sequence
/proc/mounts contains \012 instead of \n in path (see getmntent.3)
Since grep 3.8, grep "\\012" reports a warning "stray \ before 0"
(disabled currently in Debian) as well as for "\012" and '\012'
(which work too), while '\\012' doesn't warn.
Thanks to Jirka Hladky for the report.
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
---
utils/hwloc/hwloc-gather-topology.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/hwloc/hwloc-gather-topology.in b/utils/hwloc/hwloc-gather-topology.in
index 71e01cb43..3f3ee95af 100644
--- a/utils/hwloc/hwloc-gather-topology.in
+++ b/utils/hwloc/hwloc-gather-topology.in
@@ -3,7 +3,7 @@
#
# Copyright © 2009 CNRS
-# Copyright © 2009-2024 Inria. All rights reserved.
+# Copyright © 2009-2025 Inria. All rights reserved.
# Copyright © 2009-2012 Université Bordeaux
# Copyright © 2014 Cisco Systems, Inc. All rights reserved.
# See COPYING in top-level directory.
@@ -216,7 +216,7 @@ savebusdir() {
# we don't support path with \n since it would break in 'find ... | while read ..." above
savemntpnt() {
local encodedpath=$1
- if echo "$1" | grep "\\012" ; then
+ if echo "$1" | grep '\\012' ; then
echo "Ignoring mount point whose filename contains an end of line."
return
fi

View File

@ -1,3 +1,6 @@
* Fri Oct 17 2025 Krzysztof Pawlinski <kpawlins@redhat.com> - 2.5.0-6
- utils/gather-topology: fix a grep warning when matching octal sequence
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

View File

@ -5,6 +5,7 @@ Release: %autorelease
License: BSD-2-Clause
URL: http://www.open-mpi.org/projects/hwloc/
Source0: https://download.open-mpi.org/release/hwloc/v2.11/hwloc-%{version}.tar.bz2
Patch0: 0001-fix-a-grep-warning-when-matching-octal-sequence.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: gcc