1 |
On Mon, Nov 9, 2020 at 2:36 PM Felix Bier <Felix.Bier@×××××××××××××.com> wrote: |
2 |
> |
3 |
> This commit saves the file descriptor of /proc/self/{root,cwd} |
4 |
> before entering into the new mount namespace. When restoring the |
5 |
> previous mount namespace, it restores /proc/self/{root,cwd} |
6 |
> based on the saved file descriptors. |
7 |
> |
8 |
> Without this change, catalyst cannot be run in a chroot when |
9 |
> using the recent changes regarding mount namespaces: After the |
10 |
> mount namespace has been exited, /proc/self/root points to the "/" |
11 |
> of the host system, not the "/" of the chroot. Therefore, the |
12 |
> cleanup phase of catalyst runs outside of the chroot. |
13 |
> |
14 |
> The code is similar to how nsenter(1) sets root and cwd: |
15 |
> https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/nsenter.c#n452 |
16 |
> |
17 |
> Tested in a Gentoo chroot and in Gentoo VM (non-chroot). |
18 |
> |
19 |
> Signed-off-by: Felix Bier <felix.bier@×××××××××××××.com> |
20 |
|
21 |
Very nice. Thanks a bunch! |
22 |
|
23 |
I've committed all four patches, but not until I munged them: I |
24 |
stripped out all the headers except From/Date/Subject (and modified |
25 |
subject to remove [gentoo-catalyst], etc; then ran base64 -d on the |
26 |
body. Only then could I get the patches to apply. I really don't |
27 |
understand why. I've never had to do this before. Maybe you're sending |
28 |
the patches from a branch with a bunch of other work on it? |
29 |
|
30 |
I'd suggest making a fresh clone of catalyst and trying to apply the |
31 |
patches yourself to see if you can determine what's going on. |