On 05/13/2014 05:14 PM, Pádraig Brady wrote: > From 9c1bad82852cec8403ead49f12f53280c468a2cf Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]> > Date: Tue, 13 May 2014 15:56:34 +0100 > Subject: [PATCH] chroot: don't chdir() if not changing root > > This allows chroot to use used as a light weight tool > to change user identification for a command, > while not changing the current working directory. > > * src/chroot.c (main): If the same root is specified. i.e. '/' > then don't change the current working directory, and avoid the > overhead of the other redundant calls.
Looks good, but deserves a NEWS entry, doesn't it? BTW: a regular user can now also do $ chroot / or even $ chroot --userspec=$(id -un):$(id -gn) /" but changing the group with --user or --groups to a different one (similar to the functionality of 'newgrp') fails. Thanks & have a nice day, Berny
