git: e45b440633f9 - stable/13 - rtld direct exec: make -u behavior match the description

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 07 May 2024 08:59:33 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=e45b440633f9878baf019d3ef557bd2be103c3f9

commit e45b440633f9878baf019d3ef557bd2be103c3f9
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-04-28 20:57:54 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-07 08:59:07 +0000

    rtld direct exec: make -u behavior match the description
    
    (cherry picked from commit ef2694f368cee5957ee44b0298da88ff8360d561)
---
 libexec/rtld-elf/rtld.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 071a7cf8dde8..7110ba6c4c1a 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -6233,7 +6233,10 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
 			} else if (opt == 'p') {
 				*use_pathp = true;
 			} else if (opt == 'u') {
-				trust = false;
+				u_int ll;
+
+				for (ll = 0; ll < nitems(ld_env_vars); ll++)
+					ld_env_vars[ll].val = NULL;
 			} else if (opt == 'v') {
 				machine[0] = '\0';
 				mib[0] = CTL_HW;