Reputation: 21
and do following test:
- gcc -o mntns mntns.c
- the run with $ sudo ./mntns
- secret_dir='mktemp -d --tmpdir=/tmp'
- mount -n -o size=1m -t tmpfs tmpfs $secret_dir
- df -h , show it includes the tmpdir created in step 3, /tmp/tmp.sFsCzTDhjE
- open another shell console, run df -h, it also includes /tmp/tmp.sFsCzTDhjE
So it seems the CLONE_NEWNS can not make mounts isolated, still can be seen in other mount namespace. Could someone helped this question ? Searched a lots of examples, they just tried this, but not talked about this issue.
Upvotes: 0
Views: 229
Reputation: 21
I solved it. you can check this comment #2 https://bbs.archlinux.org/viewtopic.php?id=194388
it helped this issue, and solved the visible namespace question asked before.
Upvotes: 1