public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf: Properly remove the initial 'env' command
@ 2024-02-09 12:54 H.J. Lu
  2024-02-09 13:00 ` Florian Weimer
  2024-02-09 13:16 ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: H.J. Lu @ 2024-02-09 12:54 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer

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 check
'env' instead.  This fixes [BZ #31357].
---
 elf/tst-rtld-list-diagnostics.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-09 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 12:54 [PATCH] elf: Properly remove the initial 'env' command H.J. Lu
2024-02-09 13:00 ` Florian Weimer
2024-02-09 13:19   ` H.J. Lu
2024-02-09 13:16 ` Andreas Schwab
2024-02-09 13:30   ` Florian Weimer
2024-02-09 13:52     ` H.J. Lu
2024-02-09 14:53       ` Florian Weimer
2024-02-09 15:00         ` H.J. Lu
2024-02-09 15:17           ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).