1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-07 17:17:44 +03:00

boot: Correctly handle @saved default patterns

(cherry picked from commit 7941f11acb)
(cherry picked from commit 6189505d79)
This commit is contained in:
Jan Janssen 2022-09-04 00:22:23 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 59cff705e7
commit 04d74c5090

View File

@ -778,6 +778,12 @@ static int boot_config_find(const BootConfig *config, const char *id) {
if (!id)
return -1;
if (id[0] == '@') {
if (!strcaseeq(id, "@saved"))
return -1;
id = config->entry_selected;
}
for (size_t i = 0; i < config->n_entries; i++)
if (fnmatch(id, config->entries[i].id, FNM_CASEFOLD) == 0)
return i;