GNOME Bugzilla – Bug 679941
No permissions / sanity checks when trying to use formatter save functions
Last modified: 2013-09-24 16:03:30 UTC
If you try to save a file to /sys/foo (well, the URI variant of this), The following methods will always return True, even though they should fail (for starters, the directory is not writable and does not even exist). ges_formatter_can_save_uri () ges_formatter_save_to_uri ()
Created attachment 219323 [details] [review] check if uri is writeable A first attempt to solve this. Should I check the same thing in ges_formatter_save_to_uri as well?
Created attachment 219324 [details] [review] move code to separate function move access checking code to own function
This bug has an assigned developer but has not received activity in almost a year. Is the assigned person still working on this ?
Ah, it appears to me like this was a patch in need of review or merging. Edward, would you mind taking a quick look if this patch applies and makes sense?
Too much changed in the past 13 months. Maybe thibault can have a look ?
Created attachment 252277 [details] [review] ges-formatter: Check if directory of URI is writeable
commit 9d30f0579822e5e0a38383532637a8bb8ef3e61b Author: Paul Lange <palango@gmx.de> Date: Fri Jul 20 14:19:01 2012 +0200 ges-formatter: Check if directory of URI is writeable https://bugzilla.gnome.org/show_bug.cgi?id=679941
Review of attachment 252277 [details] [review]: ::: ges/ges-formatter.c @@ +303,3 @@ + + if (dir == NULL) + return FALSE; You're leaking "file" here @@ +312,3 @@ + GST_ERROR ("Unable to write to directory: %s", (*error)->message); + + return FALSE; And here "file" and "dir" @@ +318,3 @@ + if (!writeable) { + GST_ERROR ("Unable to write to directory"); + return FALSE; And here "file", "dir" and "info"
commit fbe18c9ed166bd8a063278af6e1f8c2c2ef6f853 Author: Thibault Saunier <thibault.saunier@collabora.com> Date: Tue Aug 20 08:22:24 2013 -0400 formatter: Plug leaks in the can_save_to_uri method https://bugzilla.gnome.org/show_bug.cgi?id=679941