namespace: properly label device nodes we create

https://bugzilla.redhat.com/show_bug.cgi?id=1081429
(cherry picked from commit dd078a1ef8)
This commit is contained in:
Lennart Poettering
2014-06-22 22:48:53 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 4b700b54f5
commit 415796b702
+4
View File
@@ -42,6 +42,7 @@
#include "mkdir.h"
#include "dev-setup.h"
#include "def.h"
#include "label.h"
typedef enum MountMode {
/* This is ordered by priority! */
@@ -223,7 +224,10 @@ static int mount_dev(BindMount *m) {
goto fail;
}
label_context_set(d, st.st_mode);
r = mknod(dn, st.st_mode, st.st_rdev);
label_context_clear();
if (r < 0) {
r = -errno;
goto fail;