coreutils
[Top][All Lists]
Advanced

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

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


From: Pádraig Brady
Subject: RFC: avoid chroot() call if not changing root dir
Date: Tue, 13 May 2014 16:14:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

I was considering changing the coreutils tests from using
the internal setuidgid test utility to chroot --user...
to give more coverage for the latter.

However I noticed that chroot changes directory to /
even when we're just using it to change user IDs
(by specifying / as the "new" root).

So I was wondering about the attached to avoid the
chdir("/") in this case?  The chdir() is done to enhance
security a bit, but also for consistency. If we'd not
actually changing root dir then there are no security implications,
but I'm a bit worried about the consistency angle.
Now --user is a newish feature anyway so I'm not
that worried about breaking old scripts that assume
the implicit chdir("/").

thanks,
Pádraig.

Attachment: chroot-nochdir.patch
Description: Text Data


reply via email to

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