namespace: rework namespace support

- don't use pivot_root() anymore, just reuse root hierarchy
- first create all mounts, then mark them read-only so that we get the
  right behaviour when people want writable mounts inside of
  read-only mounts
- don't pass invalid combinations of MS_ constants to the kernel
This commit is contained in:
Lennart Poettering
2012-08-13 15:27:04 +02:00
parent 6f67a45d8e
commit ac0930c892
6 changed files with 117 additions and 145 deletions
+2 -1
View File
@@ -3011,7 +3011,8 @@ unsigned long long random_ull(void) {
uint64_t ull;
ssize_t r;
if ((fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY)) < 0)
fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0)
goto fallback;
r = loop_read(fd, &ull, sizeof(ull), true);