Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

chroot() and unchroot

9 views
Skip to first unread message

Dustin Sallings

unread,
Feb 26, 2000, 3:00:00 AM2/26/00
to

Hey, I was just looking at chroot, and was wondering what the
downside might be of changing this code:

if (fdp->fd_rdir != NULL) {
vrele(fdp->fd_rdir);
vrele(fdp->fd_cdir);
VREF(nd.ni_vp);
fdp->fd_cdir = nd.ni_vp;
}

to this:

/* Don't allow chroots to chroot */
if (fdp->fd_rdir != NULL) {
return(EPERM);
}

Are there any legitimate cases where a chrooted thing chroots
again nowadays? I can imagine where it'd be useful, but I'm not sure how
widely it'd be used...perhaps make double chroots optional at compile
time?

--
dustin sallings The world is watching America,
http://2852210114/~dustin/ and America is watching TV.


0 new messages