diff --git a/.dleyna-server.metadata b/.dleyna-server.metadata new file mode 100644 index 0000000..e9124b1 --- /dev/null +++ b/.dleyna-server.metadata @@ -0,0 +1 @@ +efd83a8a0588327c7c3604cb48af4abb95a96a47 SOURCES/dleyna-server-0.5.0.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb2daef --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/dleyna-server-0.5.0.tar.gz diff --git a/SOURCES/0001-Device-Fix-ChildCount-property-type.patch b/SOURCES/0001-Device-Fix-ChildCount-property-type.patch new file mode 100644 index 0000000..140e685 --- /dev/null +++ b/SOURCES/0001-Device-Fix-ChildCount-property-type.patch @@ -0,0 +1,26 @@ +From 00ca5e70e755954c510cb4e2e42a8a5a52a071c0 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Thu, 17 Jul 2014 17:52:13 +0200 +Subject: [PATCH] [Device] Fix ChildCount property type + +It's a uint32, not a signed int. +--- + libdleyna/server/props.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libdleyna/server/props.c b/libdleyna/server/props.c +index fc26ec2..13e76b5 100644 +--- a/libdleyna/server/props.c ++++ b/libdleyna/server/props.c +@@ -622,7 +622,7 @@ static void prv_add_variant_prop(GVariantBuilder *vb, const gchar *key, + + void dls_props_add_child_count(GVariantBuilder *item_vb, gint value) + { +- prv_add_int_prop(item_vb, DLS_INTERFACE_PROP_CHILD_COUNT, value); ++ prv_add_uint_prop(item_vb, DLS_INTERFACE_PROP_CHILD_COUNT, value); + } + + static void prv_add_bool_prop(GVariantBuilder *vb, const gchar *key, +-- +2.1.0 + diff --git a/SOURCES/0001-Fix-possible-use-after-free-on-exit.patch b/SOURCES/0001-Fix-possible-use-after-free-on-exit.patch new file mode 100644 index 0000000..907c732 --- /dev/null +++ b/SOURCES/0001-Fix-possible-use-after-free-on-exit.patch @@ -0,0 +1,55 @@ +From 2a09e2b15e7493256de4f40331ce6be4e1fe90f4 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Thu, 3 Dec 2015 18:28:46 +0100 +Subject: [PATCH] Fix possible use-after-free on exit + +When the last client of dleyna-server exits, and dleyna-server +tries to exit, it might use the "upnp" pointer after it was freed as we +receive a signal where the user_data is invalid. Avoid that by zero'ing +freed pointers and disconnecting from the signal for which "upnp" is +user_data. + +See https://retrace.fedoraproject.org/faf/reports/855440/ +--- + libdleyna/server/server.c | 5 ++++- + libdleyna/server/upnp.c | 3 +++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/libdleyna/server/server.c b/libdleyna/server/server.c +index ec725de3f6b3..865336162d61 100644 +--- a/libdleyna/server/server.c ++++ b/libdleyna/server/server.c +@@ -1352,12 +1352,15 @@ static void prv_control_point_stop_service(void) + { + uint i; + +- if (g_context.manager) ++ if (g_context.manager) { + dls_manager_delete(g_context.manager); ++ g_context.manager = NULL; ++ } + + if (g_context.upnp) { + dls_upnp_unsubscribe(g_context.upnp); + dls_upnp_delete(g_context.upnp); ++ g_context.upnp = NULL; + } + + if (g_context.connection) { +diff --git a/libdleyna/server/upnp.c b/libdleyna/server/upnp.c +index 6d6c696dd42c..dcf31d98f171 100755 +--- a/libdleyna/server/upnp.c ++++ b/libdleyna/server/upnp.c +@@ -547,6 +547,9 @@ dls_upnp_t *dls_upnp_new(dleyna_connector_id_t connection, + void dls_upnp_delete(dls_upnp_t *upnp) + { + if (upnp) { ++ g_signal_handlers_disconnect_by_func (G_OBJECT (upnp->context_manager), ++ G_CALLBACK(prv_on_context_available), ++ upnp); + g_object_unref(upnp->context_manager); + g_hash_table_unref(upnp->property_map); + g_hash_table_unref(upnp->filter_map); +-- +2.5.5 + diff --git a/SOURCES/0001-Include-libgupnp-gupnp-context-manager.h.patch b/SOURCES/0001-Include-libgupnp-gupnp-context-manager.h.patch new file mode 100644 index 0000000..f810eb1 --- /dev/null +++ b/SOURCES/0001-Include-libgupnp-gupnp-context-manager.h.patch @@ -0,0 +1,27 @@ +From 7c7331440d22b1e987d0e6fd0d4337e57011e6cc Mon Sep 17 00:00:00 2001 +From: Dominique Leuenberger +Date: Mon, 14 Nov 2016 12:51:11 +0100 +Subject: [PATCH] Include libgupnp/gupnp-context-manager.h + +As we make use of the type 'GUPnPContextManager' we need to ensure that +this is known here. Relying on any other random header to being this in +for us is unreliable (and has been seen failing in the wild). +--- + libdleyna/server/upnp.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libdleyna/server/upnp.h b/libdleyna/server/upnp.h +index 6e1aa556c473..ca053fc53eae 100755 +--- a/libdleyna/server/upnp.h ++++ b/libdleyna/server/upnp.h +@@ -24,6 +24,7 @@ + #define DLS_UPNP_H__ + + #include ++#include + + #include "client.h" + #include "async.h" +-- +2.9.3 + diff --git a/SPECS/dleyna-server.spec b/SPECS/dleyna-server.spec new file mode 100644 index 0000000..3031fa0 --- /dev/null +++ b/SPECS/dleyna-server.spec @@ -0,0 +1,96 @@ +%global api 1.0 + +Name: dleyna-server +Version: 0.5.0 +Release: 3%{?dist} +Summary: Service for interacting with Digital Media Servers + +License: LGPLv2 +URL: https://01.org/dleyna/ +Source0: https://01.org/dleyna/sites/default/files/downloads/%{name}-%{version}.tar.gz + +BuildRequires: autoconf automake libtool +BuildRequires: pkgconfig(dleyna-core-1.0) >= 0.5.0 +BuildRequires: pkgconfig(gio-2.0) >= 2.28 +BuildRequires: pkgconfig(glib-2.0) >= 2.28 +BuildRequires: pkgconfig(gobject-2.0) >= 2.28 +BuildRequires: pkgconfig(gssdp-1.0) >= 0.13.2 +BuildRequires: pkgconfig(gupnp-1.0) >= 0.20.3 +BuildRequires: pkgconfig(gupnp-av-1.0) >= 0.11.5 +BuildRequires: pkgconfig(gupnp-dlna-2.0) >= 0.9.4 +BuildRequires: pkgconfig(libsoup-2.4) >= 2.28.2 +Requires: dbus +Requires: dleyna-connector-dbus%{?_isa} + +# https://github.com/01org/dleyna-server/issues/145 +Patch0: 0001-Device-Fix-ChildCount-property-type.patch +# https://github.com/01org/dleyna-server/pull/151 +Patch1: 0001-Fix-possible-use-after-free-on-exit.patch +# https://github.com/01org/dleyna-server/pull/159 +Patch2: 0001-Include-libgupnp-gupnp-context-manager.h.patch + +%description +D-Bus service for clients to discover and manipulate DLNA Digital Media +Servers (DMSes). + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + + +%build +autoreconf -fiv +%configure \ + --disable-silent-rules \ + --disable-static + +# Omit unused direct shared library dependencies. +sed --in-place --expression 's! -shared ! -Wl,--as-needed\0!g' libtool + +%make_build + + +%install +%make_install +find $RPM_BUILD_ROOT -name '*.la' -delete -print + +# We don't need a -devel package because only the daemon is supposed to be +# using the library. +rm -rf $RPM_BUILD_ROOT/%{_includedir} +rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/libdleyna-server-%{api}.so +rm -rf $RPM_BUILD_ROOT/%{_libdir}/pkgconfig + + +%files +%doc AUTHORS +%doc COPYING +%doc ChangeLog +%doc README +%{_datadir}/dbus-1/services/com.intel.%{name}.service + +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/libdleyna-server-%{api}.so.* + +%{_libexecdir}/%{name}-service +%config(noreplace) %{_sysconfdir}/%{name}-service.conf + + +%changelog +* Wed Nov 01 2017 Debarshi Ray - 0.5.0-3 +- Bump version resolve conflict with z-stream +Resolves: #1479486 + +* Thu Oct 05 2017 Debarshi Ray - 0.5.0-2 +- Use arch-specific Requires on dleyna-connector-dbus +Resolves: #1479486 + +* Fri Mar 03 2017 Debarshi Ray - 0.5.0-1 +- Update to 0.5.0 +Resolves: #1386847 + +* Tue Jun 02 2015 Debarshi Ray - 0.4.0-1 +- Initial RHEL import +Resolves: #1219532