nspawn: a bench of special fileystems that should not be shifted
authorDjalal Harouni <tixxdz@opendz.org>
Thu, 26 May 2016 20:38:25 +0000 (22:38 +0200)
committerDjalal Harouni <tixxdz@opendz.org>
Thu, 26 May 2016 20:38:25 +0000 (22:38 +0200)
Add some special filesystems that should not be shifted, most of them
relate to the host and not to containers.

src/basic/missing.h
src/nspawn/nspawn-patch-uid.c

index 651e414..2077ada 100644 (file)
@@ -453,6 +453,18 @@ struct btrfs_ioctl_quota_ctl_args {
 #define MQUEUE_MAGIC 0x19800202
 #endif
 
+#ifndef SECURITYFS_MAGIC
+#define SECURITYFS_MAGIC 0x73636673
+#endif
+
+#ifndef TRACEFS_MAGIC
+#define TRACEFS_MAGIC 0x74726163
+#endif
+
+#ifndef BPF_FS_MAGIC
+#define BPF_FS_MAGIC 0xcafe4a11
+#endif
+
 #ifndef MS_MOVE
 #define MS_MOVE 8192
 #endif
index c7382d4..6b26b07 100644 (file)
@@ -300,6 +300,9 @@ static int is_procfs_sysfs_or_suchlike(int fd) {
                F_TYPE_EQUAL(sfs.f_type, PSTOREFS_MAGIC) ||
                F_TYPE_EQUAL(sfs.f_type, SELINUX_MAGIC) ||
                F_TYPE_EQUAL(sfs.f_type, SMACK_MAGIC) ||
+               F_TYPE_EQUAL(sfs.f_type, SECURITYFS_MAGIC) ||
+               F_TYPE_EQUAL(sfs.f_type, BPF_FS_MAGIC) ||
+               F_TYPE_EQUAL(sfs.f_type, TRACEFS_MAGIC) ||
                F_TYPE_EQUAL(sfs.f_type, SYSFS_MAGIC);
 }