git: 8363963a8f3f - main - rtld: fix dangerous_ld_env calculation for ld_dynamic_weak

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sat, 06 Nov 2021 04:40:27 UTC
The branch main has been updated by kib:

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

commit 8363963a8f3fc8226b1e3aa627e2fdd09688704e
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-06 03:00:52 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-06 04:40:17 +0000

    rtld: fix dangerous_ld_env calculation for ld_dynamic_weak
    
    Default value for ld_dynamic_weak is true, non-default settings should
    be activated for the false value.
    
    Reported by:    obiwac@gmail.com
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 libexec/rtld-elf/rtld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 05afe5f42c3e..5a8e4f6bbc96 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -726,7 +726,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
     }
     dangerous_ld_env = libmap_disable || libmap_override != NULL ||
 	ld_library_path != NULL || ld_preload != NULL ||
-	ld_elf_hints_path != NULL || ld_loadfltr || ld_dynamic_weak;
+	ld_elf_hints_path != NULL || ld_loadfltr || !ld_dynamic_weak;
     ld_tracing = ld_get_env_var(LD_TRACE_LOADED_OBJECTS);
     ld_utrace = ld_get_env_var(LD_UTRACE);