rtld: Add support for LD_LIBRARY_PATH_FDS env variable
authorJohn Marino <draco@marino.st>
Sun, 30 Nov 2014 11:52:58 +0000 (12:52 +0100)
committerJohn Marino <draco@marino.st>
Sun, 30 Nov 2014 16:50:50 +0000 (17:50 +0100)
commit98e4cb42ffdf7b36598968a5e31d50c4a1ca73f9
tree5098bf494cd39533ece75682475ead1184ffa7dd
parent9c47603718642464b4e3cdb11ad4c9e1c964b60a
rtld: Add support for LD_LIBRARY_PATH_FDS env variable

This variable allows loading of shared libraries via directory descriptors
rather than via library paths. if LD_LIBRARY_PATH_FDS=3:4:12, the
directories represented by file descriptors 3, 4, and 12 will be searched
for shared libraries before the normal path-based mechanisms are used.
This allows the execution of unpriviledge binaries from within a Capsicum
sandbox even if they require shared libraries.  Note that Capsicum is not
available on DragonFly yet.

While here, adjust whitespace and rearrange a bit to minimize differences
with FreeBSD rtld.

Taken from: FreeBSD svn 267678 (20 June 2014)
libexec/rtld-elf/rtld.1
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld_printf.c
libexec/rtld-elf/rtld_printf.h