coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: avoid chroot() call if not changing root dir


From: Bernhard Voelker
Subject: Re: RFC: avoid chroot() call if not changing root dir
Date: Wed, 14 May 2014 00:45:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

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?= <address@hidden>
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]