Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2006 15:48:50 -0400
From:      Kris Kennaway <kris@obsecurity.org>
To:        Sean McNeil <sean@mcneil.com>
Cc:        emulation@freebsd.org, Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Linux expr command vs. FreeBSD version
Message-ID:  <20060504194850.GA70598@xor.obsecurity.org>
In-Reply-To: <1146763983.98779.12.camel@triton.mcneil.com>
References:  <1146610240.80438.4.camel@triton.mcneil.com> <20060504164959.GA67641@xor.obsecurity.org> <1146763983.98779.12.camel@triton.mcneil.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--zYM0uCDKw75PZbzx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, May 04, 2006 at 10:33:03AM -0700, Sean McNeil wrote:
> On Thu, 2006-05-04 at 12:49 -0400, Kris Kennaway wrote:
> > On Tue, May 02, 2006 at 03:50:40PM -0700, Sean McNeil wrote:
> > >=20
> > > I ran into a problem with paths when running linux emulation.  It
> > > appears that when looking for a file, linux emulation will first
> > > try /compat/linux/path and if not found, /path.  This causes grief wi=
th
> > > expr as the Linux version supports enhancements like "expr match"
> > > whereas the FreeBSD version does not.  To get around the issue, I put=
 a
> > > symlink in /compat/linux/bin/expr -> /compat/linux/usr/bin/expr. I do=
n't
> > > know of any better solution.  Anyone?
> >=20
> > Why is this an issue for you?
>=20
> Like I said, the FreeBSD expr command doesn't support things like "expr
> match".  FreeBSD puts expr in /bin and Linux puts it in /usr/bin.
> Appropriately, my path looks at /bin before /usr/bin.
>=20
> I have scripts that run perfect on a Linux machine and fail on FreeBSD
> with Linux emulation because they use that very feature.

Or just run the script in a chroot (chroot /compat/linux /bin/bash
/your/script) so it doesn't see the FreeBSD filesystem at all.  This
is the only safe way to do it, really - there may be other differences
that will cause more subtle aliasing problems.

Kris

--zYM0uCDKw75PZbzx
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFEWlqhWry0BWjoQKURAt7JAKDyTpYz4cZuDpj712s9fK32AjY6rQCfZdU0
HV6uGlEdxr/vlWRAlIwRa58=
=7jSD
-----END PGP SIGNATURE-----

--zYM0uCDKw75PZbzx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060504194850.GA70598>