Skip to content

lsof: update to 4.99.7#29935

Merged
BKPepe merged 1 commit into
openwrt:masterfrom
mstorchak:lsof
Jul 7, 2026
Merged

lsof: update to 4.99.7#29935
BKPepe merged 1 commit into
openwrt:masterfrom
mstorchak:lsof

Conversation

@mstorchak

@mstorchak mstorchak commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: me
(You can find this by checking the history of the package Makefile.)

Description:

  • refresh patches
  • Add -J/-j options for JSON and JSON Lines output format.
  • lsof_free_result(): handle result == NULL
  • Fix missing parenthesis in lstat error message format
  • Fix use-after-free in lsof_select_process_regex
  • Fix truncated fd numbers in -F field output
  • Display connection state for UDP sockets with -T option

🧪 Run Testing Details

  • OpenWrt Version: r34703+2-aa96b3ad55
  • OpenWrt Target/Subtarget: qualcommax/ipq807x
  • OpenWrt Device: Dynalink DL-WRX36

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@mstorchak mstorchak marked this pull request as ready for review July 6, 2026 09:54
@mstorchak mstorchak force-pushed the lsof branch 2 times, most recently from 3bc0b98 to f7ad93c Compare July 6, 2026 10:42
Subject: [PATCH] don't build man pages

- Not all build environments may have groff-base installed
- We don't install them anyway

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked into this patch. You are right, the man pages are built during compilation but they never make it into the package, you are right, but... MAKE_FLAGS += man8_MANS= achieves the same result without maintaining a patch that needs rebasing on every version bump.

Ideally, lsof upstream could add a --disable-manpages configure option. That might be worth an upstream PR or we can just create issue to ask for it.

Please don't take this the wrong way, but since we are already adding a commit subject and commit description here, I think we can make it even better and fully polish it. 😇

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestions!
I'm inclined to take the easy route and disable man pages locally with MAKE_FLAGS, but I'll check what it takes to add --disable-manpages

@mstorchak mstorchak Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BKPepe , I'm not an autotools expect to any degree, but by repeating the pattern, I've got this:

diff --git a/Makefile.am b/Makefile.am
index 9cd951c..2063e0f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -221,11 +221,14 @@ EXTRA_DIST += 00.README.FIRST 00CREDITS 00DCACHE 00DIALECTS 00DIST 00FAQ 00LSOF-
 # Testing
 EXTRA_DIST += tests/00README tests/TestDB tests/CkTestDB tests/Makefile tests/LsofTest.h check.bash

+if INSTALL_MANPAGES
 # Manpages
 lsof.man: Lsof.8 version 00DIALECTS
        soelim < Lsof.8 > $@
 man8_MANS = lsof.man
 EXTRA_DIST += Lsof.8
+endif
+
 # Fix distcheck error
 clean-local:
        rm -rf lsof.man
diff --git a/configure.ac b/configure.ac
index ef664c9..ac143db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -272,6 +272,11 @@ AS_IF([test "x$enable_security" = xyes], [
        CFLAGS="$CFLAGS -DHASSECURITY"
 ])

+# --disable-manpages to stop building and installing lsof.8
+AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages],
+       [do not build and install lsof.8]), [], [enable_manpages=yes])
+AM_CONDITIONAL([INSTALL_MANPAGES], [test "x$enable_manpages" = xyes])
+
 # --enable-no-sock-security to define HASNOSOCKSECURITY
 AC_ARG_ENABLE(no_sock_security, AS_HELP_STRING([--enable-no-sock-security],
        [combined with --enable-security, allow anyone to list anyone else's socket files]), [], [enable_no_sock_security=no])

It builds the man page by default, and does not build it with --disable-manpages
Does the change look ok? If it does, I can try to upstream it, and until it's accepted use your MAKE_FLAGS= method.

./configure --help:

...
  --enable-security       allow only the root user to list all open files
  --enable-no-sock-security
                          combined with --enable-security, allow anyone to
                          list anyone else's socket files
  --disable-manpages      do not build and install lsof.8
  --disable-largefile     omit support for large files
  --enable-year2038       support timestamps after 2038
...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just nitpick: INSTALL_MANPAGES x ENABLE_MANPAGES to be in sync with configure.ac

Otherwise LGTM. Thanks! :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstorchak mstorchak marked this pull request as draft July 7, 2026 11:45
- convert the patch to a make option
- Add -J/-j options for JSON and JSON Lines output format.
- lsof_free_result(): handle result == NULL
- Fix missing parenthesis in lstat error message format
- Fix use-after-free in lsof_select_process_regex
- Fix truncated fd numbers in -F field output
- Display connection state for UDP sockets with -T option

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
@mstorchak mstorchak marked this pull request as ready for review July 7, 2026 17:06
@BKPepe BKPepe merged commit f31a9bf into openwrt:master Jul 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants