Date: Fri, 20 Jun 2014 20:03:56 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: Jonathan Anderson <jonathan@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r267678 - head/libexec/rtld-elf Message-ID: <613FB32F-6862-4A7E-81C2-227577849FC5@FreeBSD.org> In-Reply-To: <201406201708.s5KH8WVP017030@svn.freebsd.org> References: <201406201708.s5KH8WVP017030@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 20 Jun 2014, at 19:08, Jonathan Anderson <jonathan@freebsd.org> wrote: > Author: jonathan > Date: Fri Jun 20 17:08:32 2014 > New Revision: 267678 > URL: http://svnweb.freebsd.org/changeset/base/267678 > > Log: > Add the LD_LIBRARY_PATH_FDS environmental variable. > > This variable allows the 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 searched for shared libraries > before the normal path-based mechanisms are used. This allows us to execute > unprivileged binaries from within a Capsicum sandbox even if they require > shared libraries. ... > Modified: head/libexec/rtld-elf/rtld.c > ============================================================================== > --- head/libexec/rtld-elf/rtld.c Fri Jun 20 15:43:58 2014 (r267677) > +++ head/libexec/rtld-elf/rtld.c Fri Jun 20 17:08:32 2014 (r267678) ... > +static int > +parse_libdir(const char *str) > +{ > + static const int RADIX = 10; /* XXXJA: possibly support hex? */ > + const char *orig; > + int fd; > + char c; > + > + orig = str; > + fd = 0; > + for (c = *str; c != '\0'; c = *++str) { > + if (c < '0' || c > '9') > + return (-1); > + > + fd *= RADIX; > + fd += c - '0'; > + } > + > + /* Make sure we actually parsed something. */ > + if (str == orig) { > + _rtld_error("failed to parse directory FD from '%s'", str); > + return (-1); > + } > + return (fd); > +} Shouldn't the first "return (-1)" also be preceded by a call _rtld_error()? -Dimitry [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlOkd5oACgkQsF6jCi4glqPm9QCdG1+03/fOycT/Cz79lQgkbfvV PncAnRrevVuORUBJUrlkIIQOT/5DGTN1 =RdnM -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?613FB32F-6862-4A7E-81C2-227577849FC5>
