gpt-auto: don't assume XBOOTLDR is vfat

Let's not assume "umask=" is a valid mount option for XBOOTLDR
partitions unconditionally.

Fixes: #14165
This commit is contained in:
Lennart Poettering 2020-01-07 17:21:24 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 5ac8b50d58
commit 4f0840669e

View file

@ -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);
}