diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-29 14:19:22 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-11-22 08:25:27 +0100 |
commit | 6c78120a2db66990f872fa03dd14dd77d452e57d (patch) | |
tree | 9fa33689efd421085439e40d64b5817216ec2816 /src/basic/mount-util.c | |
parent | 51aff105274d23b4545c9753bfc50258595feb5d (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.c | 13 |
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; |