namespace: fix MAC labels of /dev when PrivateDevices=yes
Without changing the SELinux label for private /dev of a service, it will take a generic file system label: system_u:object_r:tmpfs_t:s0 After this change it is the same as without `PrivateDevices=yes`: system_u:object_r:device_t:s0 This helps writing SELinux policies, as the same rules for `/dev` will apply despite any `PrivateDevices=yes` setting.
This commit is contained in:
committed by
Topi Miettinen
parent
07336a0672
commit
e6e81ec0a5
+4
-1
@@ -9,7 +9,10 @@ typedef enum LabelFixFlags {
|
||||
LABEL_IGNORE_EROFS = 1 << 1,
|
||||
} LabelFixFlags;
|
||||
|
||||
int label_fix(const char *path, LabelFixFlags flags);
|
||||
int label_fix_container(const char *path, const char *inside_path, LabelFixFlags flags);
|
||||
static inline int label_fix(const char *path, LabelFixFlags flags) {
|
||||
return label_fix_container(path, path, flags);
|
||||
}
|
||||
|
||||
int mkdir_label(const char *path, mode_t mode);
|
||||
int mkdirat_label(int dirfd, const char *path, mode_t mode);
|
||||
|
||||
Reference in New Issue
Block a user