Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2006 16:17:21 -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:  <20060504201721.GA70877@xor.obsecurity.org>
In-Reply-To: <1146773314.46954.1.camel@triton.mcneil.com>
References:  <1146610240.80438.4.camel@triton.mcneil.com> <20060504164959.GA67641@xor.obsecurity.org> <1146763983.98779.12.camel@triton.mcneil.com> <20060504194850.GA70598@xor.obsecurity.org> <1146773314.46954.1.camel@triton.mcneil.com>

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

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

On Thu, May 04, 2006 at 01:08:34PM -0700, Sean McNeil wrote:
> On Thu, 2006-05-04 at 15:48 -0400, Kris Kennaway wrote:
> > 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 grie=
f with
> > > > > 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 don'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 "ex=
pr
> > > 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.
> >=20
> > 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.
>=20
> This is what I was asking (a better solution?)

Yeah, that's why I needed to find out what your actual problem was
first :-)

>, but unfortunately you
> have to be superuser to change the root directory whereas I want to run
> things as a normal user.

Oh well, I don't think there's much you can do here as a normal user.

Kris
--W/nzBZO5zC0uMSeA
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFEWmFRWry0BWjoQKURAhwRAKD5uBgpKzt2/oli1vzRQCicVyF9EwCfZ02g
wLJj5dTEhRTPEHMYcUV9Y44=
=cURt
-----END PGP SIGNATURE-----

--W/nzBZO5zC0uMSeA--



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