diff mbox series

[v2] elf: Properly remove the initial 'env' command

Message ID 20240209131754.2353321-1-hjl.tools@gmail.com
State New
Headers show
Series [v2] elf: Properly remove the initial 'env' command | expand

Commit Message

H.J. Lu Feb. 9, 2024, 1:17 p.m. UTC
tst-rtld-list-diagnostics.py is called by

"$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics"

and $(test-wrapper-env) is set to "$(test-wrapper) env".  When there is
a test wrapper, it is incorrect to use:

    # Remove the initial 'env' command.
    parse_diagnostics(opts.command.split()[1:])

to remove 'env'.  Change tst-rtld-list-diagnostics.py to explicitly
remove 'env' instead.  This fixes [BZ #31357].
---
 elf/tst-rtld-list-diagnostics.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/elf/tst-rtld-list-diagnostics.py b/elf/tst-rtld-list-diagnostics.py
index 9e70e74bf8..c59b04d49a 100644
--- a/elf/tst-rtld-list-diagnostics.py
+++ b/elf/tst-rtld-list-diagnostics.py
@@ -294,7 +294,9 @@  def main(argv):
         check_consistency_with_manual(opts.manual)
 
     # Remove the initial 'env' command.
-    parse_diagnostics(opts.command.split()[1:])
+    options = opts.command.split()[:]
+    options.remove('env')
+    parse_diagnostics(options)
 
     if errors:
         sys.exit(1)