From: Lennart Poettering Date: Tue, 7 Jan 2020 16:21:24 +0000 (+0100) Subject: gpt-auto: don't assume XBOOTLDR is vfat X-Git-Tag: v245-rc1~174 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f0840669e172a2570b17b0991459d3a6839f804;p=thirdparty%2Fsystemd.git gpt-auto: don't assume XBOOTLDR is vfat Let's not assume "umask=" is a valid mount option for XBOOTLDR partitions unconditionally. Fixes: #14165 --- diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 4aac903aa6c..af3bd234504 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); }