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 679941 - No permissions / sanity checks when trying to use formatter save functions
No permissions / sanity checks when trying to use formatter save functions
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
git master
Other Linux
: Normal normal
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-14 21:28 UTC by Jean-François Fortin Tam
Modified: 2013-09-24 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check if uri is writeable (1.98 KB, patch)
2012-07-20 12:35 UTC, Paul Lange
none Details | Review
move code to separate function (2.67 KB, patch)
2012-07-20 13:21 UTC, Paul Lange
none Details | Review
ges-formatter: Check if directory of URI is writeable (1.93 KB, patch)
2013-08-19 19:18 UTC, Thibault Saunier
needs-work Details | Review

Description Jean-François Fortin Tam 2012-07-14 21:28:44 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 ()
Comment 1 Paul Lange 2012-07-20 12:35:32 UTC
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?
Comment 2 Paul Lange 2012-07-20 13:21:35 UTC
Created attachment 219324 [details] [review]
move code to separate function

move access checking code to own function
Comment 3 Edward Hervey 2013-08-13 18:44:38 UTC
This bug has an assigned developer but has not received activity in almost a year.

Is the assigned person still working on this ?
Comment 4 Jean-François Fortin Tam 2013-08-13 20:31:39 UTC
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?
Comment 5 Edward Hervey 2013-08-14 05:57:37 UTC
Too much changed in the past 13 months. Maybe thibault can have a look ?
Comment 6 Thibault Saunier 2013-08-19 19:18:32 UTC
Created attachment 252277 [details] [review]
ges-formatter: Check if directory of URI is writeable
Comment 7 Thibault Saunier 2013-08-19 19:26:07 UTC
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
Comment 8 Sebastian Dröge (slomo) 2013-08-20 07:47:47 UTC
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"
Comment 9 Thibault Saunier 2013-08-20 12:27:11 UTC
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