From owner-svn-src-all@FreeBSD.ORG Fri Jun 20 18:04:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E042762E; Fri, 20 Jun 2014 18:04:19 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7042B0B; Fri, 20 Jun 2014 18:04:19 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::35d6:be0d:a311:f3bd] (unknown [IPv6:2001:7b8:3a7:0:35d6:be0d:a311:f3bd]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 553DD5C37; Fri, 20 Jun 2014 20:04:14 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267678 - head/libexec/rtld-elf From: Dimitry Andric In-Reply-To: <201406201708.s5KH8WVP017030@svn.freebsd.org> Date: Fri, 20 Jun 2014 20:03:56 +0200 Message-Id: <613FB32F-6862-4A7E-81C2-227577849FC5@FreeBSD.org> References: <201406201708.s5KH8WVP017030@svn.freebsd.org> To: Jonathan Anderson X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 18:04:20 -0000 --Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Jun 2014, at 19:08, Jonathan Anderson = wrote: > Author: jonathan > Date: Fri Jun 20 17:08:32 2014 > New Revision: 267678 > URL: http://svnweb.freebsd.org/changeset/base/267678 >=20 > Log: > Add the LD_LIBRARY_PATH_FDS environmental variable. >=20 > This variable allows the loading of shared libraries via directory = descriptors > rather than via library paths. If LD_LIBRARY_PATH_FDS=3D3: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 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D 10; /* XXXJA: possibly support hex? = */ > + const char *orig; > + int fd; > + char c; > + > + orig =3D str; > + fd =3D 0; > + for (c =3D *str; c !=3D '\0'; c =3D *++str) { > + if (c < '0' || c > '9') > + return (-1); > + > + fd *=3D RADIX; > + fd +=3D c - '0'; > + } > + > + /* Make sure we actually parsed something. */ > + if (str =3D=3D 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 --Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlOkd5oACgkQsF6jCi4glqPm9QCdG1+03/fOycT/Cz79lQgkbfvV PncAnRrevVuORUBJUrlkIIQOT/5DGTN1 =RdnM -----END PGP SIGNATURE----- --Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F--