Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2009 15:06:08 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Michael Butler <imb@protected-networks.net>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>, Jamie Gritton <jamie@freebsd.org>
Subject:   Re: regression with jexec?
Message-ID:  <20090726120608.GE55190@deviant.kiev.zoral.com.ua>
In-Reply-To: <4A6BAC1A.5080303@protected-networks.net>
References:  <4A6B0BD3.6040206@protected-networks.net> <4A6B9A60.90302@FreeBSD.org> <4A6BAC1A.5080303@protected-networks.net>

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

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

On Sat, Jul 25, 2009 at 09:06:34PM -0400, Michael Butler wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
> Jamie Gritton wrote:
> > Michael Butler wrote:
> >> imb@aaron:/home/imb> sudo jexec 5 tcsh
> >> jexec: Unable to parse jail ID.: No such file or directory
>=20
> >=20
> > The symptom in jexec can be fixed by this little patch:
> >=20
> > Index: usr.sbin/jexec/jexec.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
> > --- usr.sbin/jexec/jexec.c    (revision 195879)
> > +++ usr.sbin/jexec/jexec.c    (working copy)
> > @@ -248,6 +248,7 @@
> >      if (argc < 2)
> >          usage();
> >      if (strlen(argv[0]) > 0) {
> > +        errno =3D 0;
> >          jid =3D (int)strtol(argv[0], NULL, 10);
> >          if (errno)
> >              err(1, "Unable to parse jail ID.");
>=20
> Thanks - this certainly cures the effect.
>=20
> > But the broader problem is malloc.  It's leaving errno set to
> > ENOENT when /etc/malloc.conf doesn't exist.  This seems like
> > wrong behavior to me.
>=20
> Seems like a POLA violation to me,

No, this is how errno generally work, it is not changed if no error
happens.

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

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

iEYEARECAAYFAkpsRq8ACgkQC3+MBN1Mb4gXRQCfcgfpWLjt7ZAb4sw3M1O49uyF
VcUAni2LJXn2RVg3bbFTfKI4JI/8+nyt
=fQzZ
-----END PGP SIGNATURE-----

--G2ySYTzNtMPdbLKn--



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