GNOME Bugzilla – Bug 343191
GKeyFile silently loses values
Last modified: 2006-12-18 14:14:51 UTC
With specially named keys, GKeyFile accepts the values and those are available while the GKeyFile is kept in memory. But after serialisation parsing the output back again either fails, or the key is not present. IMO GKeyFile should not accept groups/keys/values it can not read back.
Created attachment 66371 [details] testcase Failing testcases at the end with a number in comments. I realize the testcases are extreme, but IMO should be taken into account properly.
2006-12-18 Matthias Clasen <mclasen@redhat.com> * glib/gkeyfile.c: Tighten up the check for allowed key and group names. (#343191, Tommi Komulainen) * tests/keyfile-test.c: Test handling of key and group names.
it seems this patch makes (at least) update-desktop-database choke on '@' Could not parse file '/opt/local/share/applications/accessibility-keyboard.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/at-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/background.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/blackjack.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/bme.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/bonobo-browser.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/default-applications.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/display-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/evince.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/file-roller.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/font-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/freecell.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gaim.desktop': Invalid key name: Name[ca@valencia] Could not parse file '/opt/local/share/applications/gconf-editor.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gdmflexiserver-xnest.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gdmflexiserver.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gdmphotosetup.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gdmsetup.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gimp.desktop': Invalid key name: GenericName[sr@Latn] Could not parse file '/opt/local/share/applications/glines.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gmenu-simple-editor.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnect.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnibbles.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnobots2.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-about.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-font-viewer.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-network-preferences.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-settings-mouse.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-settings-sound.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-terminal.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnome-ui-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnomecc.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnometris.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnomine.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnotravex.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gnotski.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gtali.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gtk-theme-selector.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/gucharmap.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/iagno.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/inkscape.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/keybinding.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/keyboard.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/mahjongg.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/nautilus-computer.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/nautilus-file-management-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/nautilus-home.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/nautilus.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/network-scheme.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/same-gnome.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/session-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/sol.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/themus-theme-applier.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/window-properties.desktop': Invalid key name: Name[sr@Latn] Could not parse file '/opt/local/share/applications/yelp.desktop': Invalid key name: Name[nds@NFE] leaving only .desktop files lacking a 'sr@Latn' entry to be cached
Thanks for pointing that out. Should be fixed now.