Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lsof for openSUSE:Factory checked in 
at 2024-05-20 18:09:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lsof (Old)
 and      /work/SRC/openSUSE:Factory/.lsof.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lsof"

Mon May 20 18:09:47 2024 rev:52 rq:1174912 version:4.99.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/lsof/lsof.changes        2023-12-22 
22:40:49.446878935 +0100
+++ /work/SRC/openSUSE:Factory/.lsof.new.1880/lsof.changes      2024-05-20 
18:10:22.863619770 +0200
@@ -1,0 +2,15 @@
+Fri May 17 08:12:42 UTC 2024 - Jiri Slaby <[email protected]>
+
+- replace:
+  0002-tests-fix-for-kernel-6.9.patch
+  by upstream proposed:
+  0002-linux-Maintain-original-output-for-pidfd-in-linux-6..patch
+
+-------------------------------------------------------------------
+Thu May 16 10:43:13 UTC 2024 - Jiri Slaby <[email protected]>
+
+- add (bsc#1224285):
+  * 0001-tests-eliminate-use-of-fgrep.patch
+  * 0002-tests-fix-for-kernel-6.9.patch
+
+-------------------------------------------------------------------

New:
----
  0001-tests-eliminate-use-of-fgrep.patch
  0002-linux-Maintain-original-output-for-pidfd-in-linux-6..patch

BETA DEBUG BEGIN:
  New:- add (bsc#1224285):
  * 0001-tests-eliminate-use-of-fgrep.patch
  * 0002-tests-fix-for-kernel-6.9.patch
  New:  by upstream proposed:
  0002-linux-Maintain-original-output-for-pidfd-in-linux-6..patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lsof.spec ++++++
--- /var/tmp/diff_new_pack.RPHRdL/_old  2024-05-20 18:10:23.611647004 +0200
+++ /var/tmp/diff_new_pack.RPHRdL/_new  2024-05-20 18:10:23.615647149 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package lsof
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,8 @@
 URL:            https://github.com/lsof-org/lsof
 Source:         
https://github.com/lsof-org/lsof/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Patch0:         lsof-4.99.3-fix-version-in-configure-ac.patch
+Patch1:         0001-tests-eliminate-use-of-fgrep.patch
+Patch2:         0002-linux-Maintain-original-output-for-pidfd-in-linux-6..patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  groff

++++++ 0001-tests-eliminate-use-of-fgrep.patch ++++++
From: "Jiri Slaby (SUSE)" <[email protected]>
Date: Fri, 17 May 2024 07:48:27 +0200
Subject: tests: eliminate use of fgrep
Git-repo: https://github.com/lsof-org/lsof
Git-commit: 3729186f3220814d5f07550051679377fde0cf92
Patch-mainline: submitted, https://github.com/lsof-org/lsof/pull/319
References: kernel 6.9

fgrep use is deprecated. Use grep -F instead.

See: https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a95156247098
Signed-off-by: Jiri Slaby <[email protected]>
---
 lib/dialects/linux/tests/case-20-inet6-ffffffff-handling.bash | 2 +-
 lib/dialects/linux/tests/case-20-pidfd-pid.bash               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dialects/linux/tests/case-20-inet6-ffffffff-handling.bash 
b/lib/dialects/linux/tests/case-20-inet6-ffffffff-handling.bash
index a3a62822..1e3f459b 100755
--- a/lib/dialects/linux/tests/case-20-inet6-ffffffff-handling.bash
+++ b/lib/dialects/linux/tests/case-20-inet6-ffffffff-handling.bash
@@ -30,7 +30,7 @@ expectation="n[${v6addr}]:$port"
 result=1
 if "${lsof}" -p "${pid}" -a -d fd -P -n -F n \
     | tee -a "${report}" \
-    | fgrep -q "$expectation"; then
+    | grep -Fq "$expectation"; then
     result=0
 fi
 
diff --git a/lib/dialects/linux/tests/case-20-pidfd-pid.bash 
b/lib/dialects/linux/tests/case-20-pidfd-pid.bash
index fe439e5e..ceeddb41 100755
--- a/lib/dialects/linux/tests/case-20-pidfd-pid.bash
+++ b/lib/dialects/linux/tests/case-20-pidfd-pid.bash
@@ -11,7 +11,7 @@ $TARGET | (
         exit 77
     fi
     line=$($lsof -p $pid -a -d $fd -F pfn| tr '\n' ' ')
-    if ! fgrep -q "p${pid} f${fd} n[pidfd:$pid]" <<<"$line"; then
+    if ! grep -Fq "p${pid} f${fd} n[pidfd:$pid]" <<<"$line"; then
        $lsof -p $pid -a -d $fd -F pfn
        echo
        echo $line
-- 
2.45.1


++++++ 0002-linux-Maintain-original-output-for-pidfd-in-linux-6..patch ++++++
From: Jiajie Chen <[email protected]>
Date: Fri, 17 May 2024 15:22:35 +0800
Subject: [linux] Maintain original output for pidfd in linux 6.9
Git-repo: https://github.com/lsof-org/lsof
Git-commit: c1678e3f6e4b4d984cb3078b7bf0c9e24bedb8ca
Patch-mainline: submitted, https://github.com/lsof-org/lsof/pull/319
References: kernel 6.9

Signed-off-by: Jiri Slaby <[email protected]>
---
 00DIST                     |  3 +++
 lib/dialects/linux/dproc.c | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/00DIST b/00DIST
index e4b9a972..981fb4ef 100644
--- a/00DIST
+++ b/00DIST
@@ -5587,6 +5587,12 @@ Supplement       Regenerated the 4.04 distribution to 
correct a non-
 
                fix 00DIST file <space> -> tabs
 
+4.9?.?         ????????? ??, ????
+
+               [linux] Linux 6.9 changed the pidfs appearence in procfs. Try
+               to maintain original output in lsof (#317)
+
+
 Vic Abell <[email protected]>
 July 14, 2018
 
diff --git a/lib/dialects/linux/dproc.c b/lib/dialects/linux/dproc.c
index cb6bb64f..3a7a1204 100644
--- a/lib/dialects/linux/dproc.c
+++ b/lib/dialects/linux/dproc.c
@@ -1273,6 +1273,10 @@ static int process_id(struct lsof_context *ctx, /* 
context */
 #endif     /* defined(HASEPTOPTS) */
                 if (rest && rest[0] == '[' && rest[1] == 'p')
                     fdinfo_mask |= FDINFO_PID;
+                else if (Lf->ntype == N_REGLR && rest && *rest && strcmp(pbuf, 
"pidfd") == 0) {
+                    // https://github.com/lsof-org/lsof/issues/317
+                    fdinfo_mask |= FDINFO_PID;
+                }
 
                 if ((av = get_fdinfo(ctx, pathi, fdinfo_mask, &fi)) &
                     FDINFO_POS) {
@@ -1338,6 +1342,15 @@ static int process_id(struct lsof_context *ctx, /* 
context */
                     Lf->sf |= SELPTYINFO;
                 }
 #endif /* defined(HASEPTOPTS) && defined(HASPTYEPT) */
+                else if (Lf->ntype == N_REGLR && rest && *rest && Lf->nm &&
+                         strcmp(Lf->nm, "pidfd") == 0) {
+                    // https://github.com/lsof-org/lsof/issues/317
+                    // pidfd since Linux 6.9 becomes a regular file:
+                    // /proc/PID/fd/FD -> pidfd:[INODE]
+                    (void)snpf(rest, sizeof(pbuf) - (rest - pbuf),
+                                "[pidfd:%d]", fi.pid);
+                    enter_nm(ctx, rest);
+                }
 
                 if (Lf->sf)
                     link_lfile(ctx);
-- 
2.45.1

Reply via email to