Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so Ignore LD_BIND_NOW for setuid binaries, bu...



details:   https://anonhg.NetBSD.org/src/rev/81e05f580805
branches:  trunk
changeset: 327846:81e05f580805
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Mar 18 16:05:34 2014 +0000

description:
Ignore LD_BIND_NOW for setuid binaries, but keep it in the environment
otherwise.

diffstat:

 libexec/ld.elf_so/rtld.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 2054529455b7 -r 81e05f580805 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c  Tue Mar 18 15:44:37 2014 +0000
+++ b/libexec/ld.elf_so/rtld.c  Tue Mar 18 16:05:34 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.c,v 1.172 2014/01/31 22:46:40 joerg Exp $  */
+/*     $NetBSD: rtld.c,v 1.173 2014/03/18 16:05:34 joerg Exp $  */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.172 2014/01/31 22:46:40 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.173 2014/03/18 16:05:34 joerg Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -558,7 +558,10 @@
                                *oenvp++ = *env;
                        }
                } else if (strncmp(*env, bind_var, LEN(bind_var)) == 0) {
-                       ld_bind_now = *env + LEN(bind_var);
+                       if (_rtld_trust) {
+                               ld_bind_now = *env + LEN(bind_var);
+                               *oenvp++ = *env;
+                       }
                } else if (strncmp(*env, path_var, LEN(path_var)) == 0) {
                        if (_rtld_trust) {
                                ld_library_path = *env + LEN(path_var);



Home | Main Index | Thread Index | Old Index