From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Mar 2023 16:51:52 +0000 (+0100) Subject: xdg-autostart-generator: do not warn about unknown fields X-Git-Tag: v254-rc1~928 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5a70eeecdb593f8498c0bc163d5a12297cfb55d;p=thirdparty%2Fsystemd.git xdg-autostart-generator: do not warn about unknown fields My user manager says: systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:256: Unknown key name 'Actions' in section 'Desktop Entry', ignoring. systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:258: Unknown section 'Desktop Action new-window'. Ignoring. systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:343: Unknown section 'Desktop Action preferences'. Ignoring. systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:12: Unknown key name 'Actions' in section 'Desktop Entry', ignoring. systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:13: Unknown key name 'SingleMainWindow' in section 'Desktop Entry', ignoring. systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:19: Unknown section 'Desktop Action Quit'. Ignoring. This is not useful. Those are externally-provided files, and they are likely to have entries which we know nothing about. --- diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c index 3905d4bfe19..a174648f533 100644 --- a/src/xdg-autostart-generator/xdg-autostart-service.c +++ b/src/xdg-autostart-generator/xdg-autostart-service.c @@ -350,7 +350,8 @@ XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path) { r = config_parse(NULL, service->path, NULL, "Desktop Entry\0", xdg_config_item_table_lookup, items, - CONFIG_PARSE_WARN, service, + CONFIG_PARSE_RELAXED | CONFIG_PARSE_WARN, + service, NULL); /* If parsing failed, only hide the file so it will still mask others. */ if (r < 0) {