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
[-- Attachment #1 --]
On Sat, Jul 25, 2009 at 09:06:34PM -0400, Michael Butler wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
>
> >
> > The symptom in jexec can be fixed by this little patch:
> >
> > Index: usr.sbin/jexec/jexec.c
> > ===================================================================
> > --- 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 = 0;
> > jid = (int)strtol(argv[0], NULL, 10);
> > if (errno)
> > err(1, "Unable to parse jail ID.");
>
> Thanks - this certainly cures the effect.
>
> > 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.
>
> Seems like a POLA violation to me,
No, this is how errno generally work, it is not changed if no error
happens.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)
iEYEARECAAYFAkpsRq8ACgkQC3+MBN1Mb4gXRQCfcgfpWLjt7ZAb4sw3M1O49uyF
VcUAni2LJXn2RVg3bbFTfKI4JI/8+nyt
=fQzZ
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090726120608.GE55190>
