Merge pull request #3685 from kinvolk/alessandro/inaccessible-paths

namespace: unify limit behavior on non-directory paths
This commit is contained in:
Lennart Poettering
2016-07-19 21:17:49 +02:00
committed by GitHub
13 changed files with 132 additions and 80 deletions
+18
View File
@@ -532,3 +532,21 @@ int repeat_unmount(const char *path, int flags) {
done = true;
}
}
const char* mode_to_inaccessible_node(mode_t mode) {
switch(mode & S_IFMT) {
case S_IFREG:
return "/run/systemd/inaccessible/reg";
case S_IFDIR:
return "/run/systemd/inaccessible/dir";
case S_IFCHR:
return "/run/systemd/inaccessible/chr";
case S_IFBLK:
return "/run/systemd/inaccessible/blk";
case S_IFIFO:
return "/run/systemd/inaccessible/fifo";
case S_IFSOCK:
return "/run/systemd/inaccessible/sock";
}
return NULL;
}
+2
View File
@@ -49,4 +49,6 @@ union file_handle_union {
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
};
const char* mode_to_inaccessible_node(mode_t mode);
#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ }