From: Yu Watanabe Date: Mon, 4 Sep 2017 01:55:51 +0000 (+0900) Subject: elogind-mount: allow to specify an arbitrary string for arg_mount_what when vfs is... X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4b9303ec2924f73180408479a0f160868165f756;p=elogind.git elogind-mount: allow to specify an arbitrary string for arg_mount_what when vfs is used Fixes #6591. --- diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c index b38363076..adf60c7ee 100644 --- a/src/basic/mount-util.c +++ b/src/basic/mount-util.c @@ -552,6 +552,32 @@ bool fstype_is_network(const char *fstype) { return nulstr_contains(table, fstype); } +bool fstype_is_api_vfs(const char *fstype) { + static const char table[] = + "autofs\0" + "bpf\0" + "cgroup\0" + "cgroup2\0" + "configfs\0" + "cpuset\0" + "debugfs\0" + "devpts\0" + "devtmpfs\0" + "efivarfs\0" + "hugetlbfs\0" + "mqueue\0" + "proc\0" + "pstore\0" + "ramfs\0" + "securityfs\0" + "sysfs\0" + "tmpfs\0" + "tracefs\0" + ; + + return nulstr_contains(table, fstype); +} + int repeat_unmount(const char *path, int flags) { bool done = false; diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h index 5ce7c9747..571a0eb50 100644 --- a/src/basic/mount-util.h +++ b/src/basic/mount-util.h @@ -48,6 +48,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent); #if 0 /// UNNEEDED by elogind bool fstype_is_network(const char *fstype); #endif // 0 +bool fstype_is_api_vfs(const char *fstype); union file_handle_union { struct file_handle handle;