nspawn: allow access to device nodes listed in --bind= and --bind-ro= switches
https://bugs.freedesktop.org/show_bug.cgi?id=90385
This commit is contained in:
committed by
Lennart Poettering
parent
0e85114376
commit
ce5b3ad450
@@ -5435,6 +5435,15 @@ int is_dir(const char* path, bool follow) {
|
||||
return !!S_ISDIR(st.st_mode);
|
||||
}
|
||||
|
||||
int is_device_node(const char *path) {
|
||||
struct stat info;
|
||||
|
||||
if (lstat(path, &info) < 0)
|
||||
return -errno;
|
||||
|
||||
return !!(S_ISBLK(info.st_mode) || S_ISCHR(info.st_mode));
|
||||
}
|
||||
|
||||
int unquote_first_word(const char **p, char **ret, UnquoteFlags flags) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
size_t allocated = 0, sz = 0;
|
||||
|
||||
@@ -852,6 +852,7 @@ int take_password_lock(const char *root);
|
||||
|
||||
int is_symlink(const char *path);
|
||||
int is_dir(const char *path, bool follow);
|
||||
int is_device_node(const char *path);
|
||||
|
||||
typedef enum UnquoteFlags {
|
||||
UNQUOTE_RELAX = 1,
|
||||
|
||||
Reference in New Issue
Block a user