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

Pawel Jakub Dawidek nick at garage.freebsd.pl
Wed Apr 9 17:01:04 PDT 2003


On Wed, Apr 09, 2003 at 04:35:05PM -0700, Alfred Perlstein wrote:
+> > 
+> > On Thu, 10 Apr 2003, Pawel Jakub Dawidek wrote:
+> > > 
+> > > And there can't be names spoofing. (If, ofcourse '.' is invalid char in
+> > > jail name:)). 
+> > 
+> > Sounds reasonable to me, although a bit more trouble to parse and render
+> > :-).
+> 
+> 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 = parent_pr->pr_namesize + 1;
	pr = malloc(sizeof(struct prison), M_WAITOK);
	pr->pr_name = malloc(sizeof(char *) * pr->pr_namesize);

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

Separators aren't needed.

-- 
Pawel Jakub Dawidek                       pawel at dawidek.net
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 305 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20030410/06e12fcb/attachment.bin


More information about the cvs-all mailing list