Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2003 02:01:15 +0200
From:      Pawel Jakub Dawidek <nick@garage.freebsd.pl>
To:        Alfred Perlstein <bright@mu.org>
Cc:        Mike Barcroft <mike@FreeBSD.org>
Subject:   Re: cvs commit: src/usr.bin/killall killall.1 killall.c src/usr.sbin Makefile src/usr.sbin/jail jail.8 jail.c src/usr.sbin/jexec Makefile jexec.8 jexec.c src/usr.sbin/jls Makefile jls.8 jls.c
Message-ID:  <20030410000115.GC1280@garage.freebsd.pl>
In-Reply-To: <20030409233505.GH30960@elvis.mu.org>
References:  <20030409230425.GB1280@garage.freebsd.pl> <Pine.NEB.3.96L.1030409191320.31027B-100000@fledge.watson.org> <20030409233505.GH30960@elvis.mu.org>

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

--/T5/D81aE6hAEKcd
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 09, 2003 at 04:35:05PM -0700, Alfred Perlstein wrote:
+> >=20
+> > On Thu, 10 Apr 2003, Pawel Jakub Dawidek wrote:
+> > >=20
+> > > And there can't be names spoofing. (If, ofcourse '.' is invalid char=
 in
+> > > jail name:)).=20
+> >=20
+> > Sounds reasonable to me, although a bit more trouble to parse and rend=
er
+> > :-).
+>=20
+> And what kind of path seperator is '.'?

Another solution:

	struct prison {
		[...]
		char	**pr_name;
		size_t	  pr_namesize;
		[...]
	}

When we creating new jail in other jail we just:

	pr->pr_namesize =3D parent_pr->pr_namesize + 1;
	pr =3D malloc(sizeof(struct prison), M_WAITOK);
	pr->pr_name =3D malloc(sizeof(char *) * pr->pr_namesize);

	for (i =3D 0; i < parent_pr->pr_namesize; ++i)
		pr->pr_name[i] =3D parent_pr->pr_name[i];
	pr->pr_name[i] =3D malloc(strlen(childname) + 1, M_WAITOK);
	strcpy(pr->pr_name[i], childname);

Separators aren't needed.

--=20
Pawel Jakub Dawidek                       pawel@dawidek.net
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net

--/T5/D81aE6hAEKcd
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQCVAwUBPpS0Sz/PhmMH/Mf1AQH7RAP/XoRzzNsM6IPGk7Yeijivuz66OmZ1vxAN
EBzf2yAatrgS6SifQqX5ZBBHhrV2y1/E6rwgGFsj0T9M2GGVQjZArdd+xUaABuwy
WW80lr+RJXaH1VBbe0D4fWJdX+EFarDx/foqEveleq7Zpxe46nVO3lNoOK1ejjp8
6rO2Cw78z8s=
=IRs2
-----END PGP SIGNATURE-----

--/T5/D81aE6hAEKcd--



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