From 298286be2d8ceacc426dedecc0e38a3f82d8aedc Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Tue, 22 Mar 2022 10:47:34 +0100 Subject: [PATCH] build-export: Explicitly allow empty Exec values in desktop file --- app/flatpak-builtins-build-export.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c index 0c1743ac..4924fb92 100644 --- a/app/flatpak-builtins-build-export.c +++ b/app/flatpak-builtins-build-export.c @@ -491,6 +491,12 @@ check_refs: if (!g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, error)) return FALSE; + /* Validate Exec command: The key should be present and – if set to a + * non-empty value – should point to an existing binary. + * + * Empty values are allowed, they will result in the default command being + * run by Flatpak when starting the application. + */ command = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_EXEC, @@ -500,10 +506,9 @@ check_refs: g_print (_("WARNING: Can't find Exec key in %s: %s\n"), path, local_error->message); g_clear_error (&local_error); } - else + else if (strlen(command) > 0) { argv = g_strsplit (command, " ", 0); - bin_file = convert_app_absolute_path (argv[0], files); if (!g_file_query_exists (bin_file, NULL)) g_print (_("WARNING: Binary not found for Exec line in %s: %s\n"), path, command);