After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343191 - GKeyFile silently loses values
GKeyFile silently loses values
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2006-05-28 14:17 UTC by Tommi Komulainen
Modified: 2006-12-18 14:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (4.16 KB, text/plain)
2006-05-28 14:21 UTC, Tommi Komulainen
Details

Description Tommi Komulainen 2006-05-28 14:17:42 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.
Comment 1 Tommi Komulainen 2006-05-28 14:21:20 UTC
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.
Comment 2 Matthias Clasen 2006-12-18 07:30:27 UTC
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.

Comment 3 paul 2006-12-18 12:23:22 UTC
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
Comment 4 Matthias Clasen 2006-12-18 14:14:51 UTC
Thanks for pointing that out. Should be fixed now.