From c45c51fe97193898f3909dcf5e4c0e117ab239a2 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 1 May 2009 23:50:11 +0200 Subject: chroot: accept new options --userspec=U:G and --groups=G1,G2,G3 * NEWS: Note chroot's new options. * doc/coreutils.texi: Document them. * src/chroot.c (main): Add support for --userspec and --groups. * tests/Makefile.am (root-tests): Add chroot/credentials. * tests/chroot/credentials: New file. * tests/test-lib.sh: Define NON_ROOT_GROUP to a default value. --- doc/coreutils.texi | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 1a3075ffe..97ea830e1 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -14144,7 +14144,7 @@ underlying function is non-privileged due to lack of support in MS-Windows.} Synopses: @example -chroot @var{newroot} [@var{command} [@var{args}]@dots{}] +chroot @var{option} @var{newroot} [@var{command} [@var{args}]@dots{}] chroot @var{option} @end example @@ -14157,8 +14157,25 @@ variable or @command{/bin/sh} if not set, invoked with the @option{-i} option. @var{command} must not be a special built-in utility (@pxref{Special built-in utilities}). -The only options are @option{--help} and @option{--version}. @xref{Common -options}. Options must precede operands. +The program accepts the following options. Also see @ref{Common options}. +Options must precede operands. + +@table @samp + +@itemx --userspec=@var{user}[:@var{group}] +@opindex --userspec +By default, @var{command} is run with the same credentials +as the invoking process. +Use this option to run it as a different @var{user} and/or with a +different primary @var{group}. + +@itemx --groups=@var{groups} +@opindex --groups +Use this option to specify the supplementary @var{groups} to be +used by the new process. +The items in the list (names or numeric IDs) must be separated by commas. + +@end table Here are a few tips to help avoid common problems in using chroot. To start with a simple example, make @var{command} refer to a statically -- cgit v1.2.3-70-g09d2