From owner-freebsd-bugs Wed Jan 23 10:45:11 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from vexpert.dbai.tuwien.ac.at (vexpert.dbai.tuwien.ac.at [128.130.111.12]) by hub.freebsd.org (Postfix) with ESMTP id D926137B400; Wed, 23 Jan 2002 10:45:06 -0800 (PST) Received: from naos (naos [128.130.111.28]) by vexpert.dbai.tuwien.ac.at (8.11.6/8.11.6) with ESMTP id g0NIj4B13324; Wed, 23 Jan 2002 19:45:05 +0100 (MET) Date: Wed, 23 Jan 2002 19:45:02 +0100 (CET) From: Gerald Pfeifer To: Ruslan Ermilov Cc: freebsd-bugs@freebsd.org Subject: Re: bin/34159: chroot man page-implementation mismatch In-Reply-To: <20020123201330.A25404@sunbay.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 23 Jan 2002, Ruslan Ermilov wrote: > The point here is that chroot(8) doesn't have a code that prevents it > from working under non-root, but chroot(2) does. chroot(8) can be > EXECUTED by a regular user too, but the result will be different. > Also, chroot(8) behaves differently under jails. Ah, I see! You have to admit this is not immediate for someone who's really a FreeBSD guru, though. > I disagree. It's clear that "chroot(8) changes its root directory to > that specified, and then executes the command or a shell". Could I convince you to accept/install the following patch? (It makes it more clearly, and you used "then" in your description as well.) ;-) Index: chroot.8 =================================================================== RCS file: /sw/FreeBSD/CVSUP/src/usr.sbin/chroot/chroot.8,v retrieving revision 1.9 diff -u -3 -p -r1.9 chroot.8 --- chroot.8 2002/01/22 10:44:02 1.9 +++ chroot.8 2002/01/23 18:29:36 @@ -47,7 +47,7 @@ The .Nm command changes its root directory to the supplied directory .Ar newroot -and exec's +and then exec's .Ar command , if supplied, or an interactive copy of your shell. .Sh ENVIRONMENT >> Also, the documentation does not make it clear that "your shell" >> apparently refers to the shell in /etc/passwd, not the shell you're >> currently running. > How it could be unclear from reading the ENVIRONMENT section that > chroot(8) runs ${SHELL} or /bin/sh if SHELL is unset? I must have been blind, sorry. How about the following? Index: environ.7 =================================================================== RCS file: /sw/FreeBSD/CVSUP/src/share/man/man7/environ.7,v retrieving revision 1.17 diff -u -3 -p -r1.17 environ.7 --- environ.7 2001/07/14 19:41:13 1.17 +++ environ.7 2002/01/23 18:41:42 @@ -187,6 +187,7 @@ and unless you know what you are doing. .Sh SEE ALSO .Xr cd 1 , +.Xr chroot 8 , .Xr csh 1 , .Xr ex 1 , .Xr login 1 , @@ -198,7 +199,8 @@ unless you know what you are doing. .Xr setlocale 3 , .Xr system 3 , .Xr termcap 3 , -.Xr termcap 5 +.Xr termcap 5 , +.Xr vi 1 .Sh HISTORY The .Nm (Adding chroot may not be that important, but as ex(1) is mentioned exactly once, also vi(1), which is mentioned at the same place, should be cross-referenced.) Gerald -- Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message