summaryrefslogtreecommitdiff
path: root/src/shared/dissect-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-07 11:29:38 +0100
committerLennart Poettering <lennart@poettering.net>2023-03-09 21:56:42 +0100
commit6eda6f7e51e8d25c12279689567008d50274cd1e (patch)
treefde809953fcbe3106b08f6efefd087831f072606 /src/shared/dissect-image.c
parent034ebc47a280e6f0f1f051ee15099b6e7fe20e9a (diff)
downloadsystemd-6eda6f7e51e8d25c12279689567008d50274cd1e.tar.gz
mountpoint-util: add new fstype_can_umask() helper
Diffstat (limited to 'src/shared/dissect-image.c')
-rw-r--r--src/shared/dissect-image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 59adb32426..2502e3a0eb 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -1537,7 +1537,9 @@ int partition_pick_mount_options(
case PARTITION_XBOOTLDR:
flags |= MS_NOSUID|MS_NOEXEC|ms_nosymfollow_supported();
- if (!fstype || streq(fstype, "vfat"))
+ /* The ESP might contain a pre-boot random seed. Let's make this unaccessible to regular
+ * userspace. ESP/XBOOTLDR is almost certainly VFAT, hence if we don't know assume it is. */
+ if (!fstype || fstype_can_umask(fstype))
if (!strextend_with_separator(&options, ",", "umask=0077"))
return -ENOMEM;
break;