[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18062: [PATCH] chroot: always change to / if not changing credential
From: |
Bernhard Voelker |
Subject: |
bug#18062: [PATCH] chroot: always change to / if not changing credentials |
Date: |
Thu, 31 Jul 2014 09:19:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 07/27/2014 10:32 PM, Pádraig Brady wrote:
Drats. This change was initially discussed at:
http://lists.gnu.org/archive/html/coreutils/2014-05/msg00033.html
There I noted that we'd want to keep doing the chdir("/") for older
scripts that might assume the working dir = /.
I.E. when not invoking with --user we'd do the chdir("/"),
but then went ahead and fluffed the implementation.
At that point I wasn't that clear about the separation of the 3 tasks
in chroot(1): a) chroot(2), b) chdir(2), and c) finding/setting uid/gid
inside and outside the jail. At least a) and b) got obviously a bit
mixed during the discussion.
Now on consideration it's probably best to not even key this change
on the --user option, and have a separate --chdir option?
As there is such a patch out now since more than a week:
http://lists.gnu.org/archive/html/bug-coreutils/2014-07/msg00083.html
would anyone comment on it?
Well, I took the way to add an internal "---skip-chdir" option,
but we can turn it into a publicly-visible "--skip-chdir" easily
if desired - although I don't see how such a probably-shoot-yourself-
in-the-foot option would help in real-world scripts. I think it'd
be clearer in such scripts to explicitly "cd" into the previous
directory.
Another idea was to re-introduce a 'setuidgid' tool built from
chroot.c without the chdir("/"), but that seemed even more awkward
than the ---skip-chdir solution.
Thanks & have a nice day,
Berny
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Andreas Schwab, 2014/07/20
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/20
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Andreas Schwab, 2014/07/20
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/20
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Andreas Schwab, 2014/07/20
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/21
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/22
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Pádraig Brady, 2014/07/27
- bug#18062: [PATCH] chroot: always change to / if not changing credentials,
Bernhard Voelker <=
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Pádraig Brady, 2014/07/31
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/31
- bug#18062: [PATCH] chroot: always change to / if not changing credentials, Bernhard Voelker, 2014/07/31