summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-01-07 17:21:24 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-01-08 09:51:42 +0100
commit4f0840669e172a2570b17b0991459d3a6839f804 (patch)
tree1789195bcdac105dc0317072e87814dc4aea9ae9 /src/gpt-auto-generator
parent5ac8b50d58946156094f7d4e6da8eec1209d9c3a (diff)
downloadsystemd-4f0840669e172a2570b17b0991459d3a6839f804.tar.gz
gpt-auto: don't assume XBOOTLDR is vfat
Let's not assume "umask=" is a valid mount option for XBOOTLDR partitions unconditionally. Fixes: #14165
Diffstat (limited to 'src/gpt-auto-generator')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 4aac903aa6..af3bd23450 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -443,6 +443,19 @@ static int add_automount(
return generator_add_symlink(arg_dest, SPECIAL_LOCAL_FS_TARGET, "wants", unit);
}
+static const char *esp_or_xbootldr_options(const DissectedPartition *p) {
+ assert(p);
+
+ /* if we probed vfat or have no idea about the file system then assume these file systems are vfat
+ * and thus understand "umask=0077". If we detected something else then don't specify any options and
+ * use kernel defaults. */
+
+ if (!p->fstype || streq(p->fstype, "vfat"))
+ return "umask=0077";
+
+ return NULL;
+}
+
static int add_xbootldr(DissectedPartition *p) {
int r;
@@ -472,7 +485,7 @@ static int add_xbootldr(DissectedPartition *p) {
"/boot",
p->fstype,
true,
- "umask=0077",
+ esp_or_xbootldr_options(p),
"Boot Loader Partition",
120 * USEC_PER_SEC);
}
@@ -546,7 +559,7 @@ static int add_esp(DissectedPartition *p, bool has_xbootldr) {
esp_path,
p->fstype,
true,
- "umask=0077",
+ esp_or_xbootldr_options(p),
"EFI System Partition Automount",
120 * USEC_PER_SEC);
}