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 704802 - new_with_path deosn't check for trailing slash in path
new_with_path deosn't check for trailing slash in path
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
2.37.x
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-07-24 12:04 UTC by Michał Sawicz
Modified: 2013-10-24 20:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GSettings: verify path validity on constructors (2.56 KB, patch)
2013-10-23 20:43 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Michał Sawicz 2013-07-24 12:04:06 UTC
>>> s = Gio.Settings.new_with_path("foo.bar", "/foo/bar")
>>> s.set_int("baz", 0)

Results in the /foo/barbaz key being set.

new_with_path should error out if there's no trailing slash for the path.
Comment 1 Allison Karlitskaya (desrt) 2013-10-23 20:43:06 UTC
Created attachment 257967 [details] [review]
GSettings: verify path validity on constructors

Don't allow constructing GSettings objects with invalid paths.
Comment 2 Matthias Clasen 2013-10-23 23:41:40 UTC
Review of attachment 257967 [details] [review]:

Looks good
Comment 3 Allison Karlitskaya (desrt) 2013-10-24 13:54:16 UTC
Attachment 257967 [details] pushed as 6568843 - GSettings: verify path validity on constructors
Comment 4 Colin Walters 2013-10-24 20:14:35 UTC
This triggers a smoketest failure in Continuous because gsettings-data-convert now segfaults on startup:

http://build.gnome.org/continuous/buildmaster/builds/20131024.38/smoketest/work-gnome-continuous-x86_64-runtime/journal-json.txt

"MESSAGE" : "(gsettings-data-convert:599): GLib-GIO-CRITICAL **: g_settings_new_with_path: assertion 'path_is_valid (path)' failed"

I'm upgrading my VM to get a useful stack now.
Comment 5 Allison Karlitskaya (desrt) 2013-10-24 20:26:00 UTC
This is fallout from evolution installing an invalid convert file and gsettings-data-convert not properly validating it.

Bug 710835.