summaryrefslogtreecommitdiff
path: root/src/basic/mount-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-09-29 14:19:22 +0200
committerSven Eden <yamakuzure@gmx.net>2017-11-22 08:25:27 +0100
commit6c78120a2db66990f872fa03dd14dd77d452e57d (patch)
tree9fa33689efd421085439e40d64b5817216ec2816 /src/basic/mount-util.c
parent51aff105274d23b4545c9753bfc50258595feb5d (diff)
dissect: automatically mark partitions read-only that have a read-only file system
Specifically, squashfs and iso9660 are always read-only, hence make sure we never even think about mounting them writable.
Diffstat (limited to 'src/basic/mount-util.c')
-rw-r--r--src/basic/mount-util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
index adf60c7ee..d8850bf83 100644
--- a/src/basic/mount-util.c
+++ b/src/basic/mount-util.c
@@ -578,6 +578,19 @@ bool fstype_is_api_vfs(const char *fstype) {
return nulstr_contains(table, fstype);
}
+bool fstype_is_ro(const char *fstype) {
+
+ /* All Linux file systems that are necessarily read-only */
+
+ static const char table[] =
+ "DM_verity_hash\0"
+ "iso9660\0"
+ "squashfs\0"
+ ;
+
+ return nulstr_contains(table, fstype);
+}
+
int repeat_unmount(const char *path, int flags) {
bool done = false;