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

[ Available lists | Index of cvs-src | Month of Apr 2003 | Week of 9 Apr 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Date
9 Apr 2003 17:01:04
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


[ Hide this part ]
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@dawidek.net
UNIX Systems Programmer/Administrator http://garage.freebsd.pl
Am I Evil? Yes, I Am! http://cerber.sourceforge.net


[ Show this part (application/pgp-signature) ]

Elapsed time: 0.261 seconds