[rygel/wip/dvd: 40/56] server: Add explicit check for @restricted



commit 99abf5f5fa6a044e95c3a86c4757fefa40ecbf8a
Author: Jens Georg <mail jensge org>
Date:   Thu Nov 5 16:09:06 2015 +0100

    server: Add explicit check for @restricted
    
    Previously the DIDL-Lite parser did that in its verification, but that broke
    broken clients.
    
    The move the code to where it was added for, Rygel's CreateObject call
    handler.
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740266

 configure.ac                                  |    2 +-
 src/librygel-server/rygel-object-creator.vala |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c71a701..789db4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,7 @@ VALA_REQUIRED=0.24.0
 VALADOC_REQUIRED=0.2
 GSSDP_REQUIRED=0.13.0
 GUPNP_REQUIRED=0.20.14
-GUPNP_AV_REQUIRED=0.12.4
+GUPNP_AV_REQUIRED=0.12.8
 GUPNP_DLNA_REQUIRED=0.9.4
 GSTREAMER_REQUIRED=1.0
 GSTPBU_REQUIRED=1.0
diff --git a/src/librygel-server/rygel-object-creator.vala b/src/librygel-server/rygel-object-creator.vala
index 7a5b076..0c31643 100644
--- a/src/librygel-server/rygel-object-creator.vala
+++ b/src/librygel-server/rygel-object-creator.vala
@@ -255,6 +255,12 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
                                         (_("Invalid upnp:class given in CreateObject"));
         }
 
+        if (!didl_object.is_restricted_set ()) {
+            var msg = _("Object is missing the @restricted attribute");
+            throw new ContentDirectoryError.BAD_METADATA (msg);
+        }
+
+
         if (didl_object.restricted) {
             throw new ContentDirectoryError.BAD_METADATA
                                         (_("Cannot create restricted item"));


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