[rygel] media-export: Use allow-upload setting



commit d31fec4bd23dcf0ac3c1e3ccc679e07012cdfc2e
Author: Jens Georg <mail jensge org>
Date:   Sun Apr 10 09:16:36 2016 +0200

    media-export: Use allow-upload setting
    
    If allow-upload is not set, do not use containers that can lead to file-system
    modification
    
    Signed-off-by: Jens Georg <mail jensge org>

 .../rygel-media-export-object-factory.vala         |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala 
b/src/plugins/media-export/rygel-media-export-object-factory.vala
index cac21cf..24ebef8 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -79,7 +79,16 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
         // to allow uploads.
         // See https://bugzilla.gnome.org/show_bug.cgi?id=676379 to
         // give more control over this.
-        return new WritableDbContainer (id, title);
+        var allow_upload = false;
+        try {
+            allow_upload = MetaConfig.get_default ().get_allow_upload ();
+        } catch (Error error) { /* Using default */ }
+
+        if (allow_upload) {
+            return new WritableDbContainer (id, title);
+        } else {
+            return new TrackableDbContainer (id, title);
+        }
     }
 
     /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]