Skip site navigation (1)Skip section navigation (2)
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

--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 <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
>=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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?613FB32F-6862-4A7E-81C2-227577849FC5>