add dbus policy conf file 42/12642/2
authorCorentin Lecouvey <corentin.lecouvey@eurogiciel.fr>
Wed, 20 Nov 2013 14:04:43 +0000 (15:04 +0100)
committerCorentin Lecouvey <corentin.lecouvey@eurogiciel.fr>
Thu, 21 Nov 2013 08:56:37 +0000 (09:56 +0100)
This patch permits root user to own 'org.download-provider' bus name.
In addition it adds a "send_destination" rule to allow traffic to this service.

Bug-Tizen: TIVI-2045 and TIVI-1629

Change-Id: I625f9dfd9626edbafb0832aa39c6879186d7ba4c
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@eurogiciel.fr>
packaging/download-provider.spec
packaging/org.download-provider.conf [new file with mode: 0644]

index 627e70d..a07bf89 100755 (executable)
@@ -7,6 +7,7 @@ Group:      Development/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    download-provider.service
+Source101:  org.download-provider.conf
 Source1001:    download-provider.manifest
 Requires(post): /usr/bin/sqlite3
 BuildRequires:  cmake
@@ -41,12 +42,14 @@ Description: download the contents in background (developement files)
 
 %prep
 %setup -q
+cp %{SOURCE101} .
 cp %{SOURCE1001} .
 
 %define _imagedir /usr/share/download-provider
 %define _databasedir /opt/usr/dbspace
 %define _databasefile %{_databasedir}/.download-provider.db
 %define _dbusservicedir /usr/share/dbus-1/system-services
+%define _dbuspolicydir /etc/dbus-1/system.d
 %define _licensedir /usr/share/license
 
 %define cmake \
@@ -82,6 +85,10 @@ make %{?jobs:-j%jobs}
 %install
 rm -rf %{buildroot}
 %make_install
+
+install -d -m 755 %{buildroot}%{_dbuspolicydir}
+install -m 644 %{SOURCE101} %{buildroot}%{_dbuspolicydir}
+
 mkdir -p %{buildroot}%{_licensedir}
 mkdir -p  %{buildroot}%{_sysconfdir}/rc.d/rc3.d
 ln -s %{_sysconfdir}/rc.d/init.d/download-provider-service  %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S70download-provider-service
@@ -181,6 +188,7 @@ fi
 %{_sysconfdir}/rc.d/rc5.d/S70download-provider-service
 %{_licensedir}/%{name}
 %{_dbusservicedir}/org.download-provider.service
+%{_dbuspolicydir}/org.download-provider.conf
 %attr(660,root,app) /opt/usr/dbspace/.download-provider.db
 %attr(660,root,app) /opt/usr/dbspace/.download-provider.db-journal
 
diff --git a/packaging/org.download-provider.conf b/packaging/org.download-provider.conf
new file mode 100644 (file)
index 0000000..945c394
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="root">
+        <allow own="org.download-provider"/>
+    </policy>
+    <policy context="default">
+        <allow send_destination="org.download-provider"/>
+    </policy>
+</busconfig>
+