From 03aead9fe7dfd1bae90467f7ec2c724a017bbdba Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 8 Aug 2018 18:07:03 +0100 Subject: [PATCH] uefi: Check the filesystem type when checking the ESP --- plugins/uefi/fu-uefi-common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/uefi/fu-uefi-common.c b/plugins/uefi/fu-uefi-common.c index 558127039..669e55145 100644 --- a/plugins/uefi/fu-uefi-common.c +++ b/plugins/uefi/fu-uefi-common.c @@ -275,6 +275,7 @@ fu_uefi_read_file_as_uint64 (const gchar *path, const gchar *attr_name) gboolean fu_uefi_check_esp_path (const gchar *path, GError **error) { + const gchar *fs_types[] = { "vfat", "ntfs", "exfat", NULL }; g_autoptr(GUnixMountEntry) mount = g_unix_mount_at (path, NULL); if (mount == NULL) { g_set_error (error, @@ -290,6 +291,15 @@ fu_uefi_check_esp_path (const gchar *path, GError **error) "%s is read only", path); return FALSE; } + if (!g_strv_contains (fs_types, g_unix_mount_get_fs_type (mount))) { + g_autofree gchar *supported = g_strjoinv ("|", (gchar **) fs_types); + g_set_error (error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "%s has an invalid type, expected %s", + path, supported); + return FALSE; + } return TRUE; }