summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyong Min <jiyong.min@samsung.com>2016-05-27 19:56:51 +0900
committerJiyong Min <jiyong.min@samsung.com>2016-05-30 10:01:25 +0900
commit2208cdce4e957b685303c397f403e263dee8e3ac (patch)
treedffd22ec272c30ed5df1debaad6c17564a29f1ae
parent71318efaa23a8708ace338ca6977058fbaa4de62 (diff)
downloadmedia-controller-2208cdce4e957b685303c397f403e263dee8e3ac.tar.gz
media-controller-2208cdce4e957b685303c397f403e263dee8e3ac.tar.bz2
media-controller-2208cdce4e957b685303c397f403e263dee8e3ac.zip
Modify user id from root to system and replace database creation to source code
Change-Id: Id37837c93e43cc512cfb06011e9e5a6d68056eab Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
-rw-r--r--packaging/capi-media-controller.spec23
-rwxr-xr-xpackaging/media-controller_create_db.sh10
-rwxr-xr-xpackaging/mediacontroller.service2
-rw-r--r--packaging/mediacontroller.socket2
-rw-r--r--svc/media_controller_db_util.c2
5 files changed, 3 insertions, 36 deletions
diff --git a/packaging/capi-media-controller.spec b/packaging/capi-media-controller.spec
index 3fad5a1..edf01da 100644
--- a/packaging/capi-media-controller.spec
+++ b/packaging/capi-media-controller.spec
@@ -1,6 +1,6 @@
Name: capi-media-controller
Summary: A media controller library in Tizen Native API
-Version: 0.1.20
+Version: 0.1.21
Release: 1
Group: Multimedia/API
License: Apache-2.0
@@ -85,20 +85,6 @@ install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/mediacontroller-ipc.socket
ln -s ../mediacontroller.socket %{buildroot}%{_unitdir}/sockets.target.wants/mediacontroller.socket
ln -s ../mediacontroller-ipc.socket %{buildroot}%{_unitdir}/sockets.target.wants/mediacontroller-ipc.socket
-# Setup DB creation in user session
-%if 0%{?multi_user}
-mkdir -p %{buildroot}%{_unitdir_user}
-mkdir -p %{buildroot}%{_unitdir_user}/default.target.wants/
-install -m 644 %{SOURCE3} %{buildroot}%{_unitdir_user}/media-controller-user.service
-ln -s ../media-controller-user.service %{buildroot}%{_unitdir_user}/default.target.wants/media-controller-user.service
-%endif
-
-# Create DB
-%if 0%{?multi_user}
-mkdir -p %{buildroot}%{_bindir}
-install -m 0775 %{SOURCE1001} %{buildroot}%{_bindir}/media-controller_create_db.sh
-%endif
-
%post
%postun
@@ -112,9 +98,6 @@ install -m 0775 %{SOURCE1001} %{buildroot}%{_bindir}/media-controller_create_db.
%files -n mediacontroller
%defattr(-,root,root,-)
%{_bindir}/mediacontroller
-%if 0%{?multi_user}
-%{_bindir}/media-controller_create_db.sh
-%endif
%manifest media-controller-service.manifest
%defattr(-,multimedia_fw,multimedia_fw,-)
%{_unitdir}/mediacontroller.service
@@ -122,10 +105,6 @@ install -m 0775 %{SOURCE1001} %{buildroot}%{_bindir}/media-controller_create_db.
%{_unitdir}/sockets.target.wants/mediacontroller.socket
%{_unitdir}/mediacontroller-ipc.socket
%{_unitdir}/sockets.target.wants/mediacontroller-ipc.socket
-%if 0%{?multi_user}
-%{_unitdir_user}/media-controller-user.service
-%{_unitdir_user}/default.target.wants/media-controller-user.service
-%endif
%{_datadir}/license/mediacontroller
%files devel
diff --git a/packaging/media-controller_create_db.sh b/packaging/media-controller_create_db.sh
deleted file mode 100755
index ac71ac8..0000000
--- a/packaging/media-controller_create_db.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-source /etc/tizen-platform.conf
-
-mkdir -p $TZ_USER_DB
-
-#Create DB file
-sqlite3 ${TZ_USER_DB}/.media_controller.db 'PRAGMA journal_mode = PERSIST;
- CREATE TABLE IF NOT EXISTS latest_server (server_name TEXT PRIMARY KEY);
-'
diff --git a/packaging/mediacontroller.service b/packaging/mediacontroller.service
index fc2b419..41e1462 100755
--- a/packaging/mediacontroller.service
+++ b/packaging/mediacontroller.service
@@ -2,7 +2,7 @@
Description=Media controller
[Service]
-Owner=multimedia_fw
+User=multimedia_fw
Group=multimedia_fw
ExecStart=/usr/bin/mediacontroller
Type=simple
diff --git a/packaging/mediacontroller.socket b/packaging/mediacontroller.socket
index af9d83a..b1ae5b1 100644
--- a/packaging/mediacontroller.socket
+++ b/packaging/mediacontroller.socket
@@ -2,7 +2,7 @@
Description=MediaController Service socket
[Socket]
-SocketOwner=multimedia_fw
+SocketUser=multimedia_fw
SocketGroup=multimedia_fw
ListenStream=/run/.mediacontroller.sock
Service=mediacontroller.service
diff --git a/svc/media_controller_db_util.c b/svc/media_controller_db_util.c
index 707b1b0..003d20a 100644
--- a/svc/media_controller_db_util.c
+++ b/svc/media_controller_db_util.c
@@ -207,7 +207,6 @@ int mc_db_util_connect(void **handle, uid_t uid)
*handle = db_handle;
-#ifndef MULTI_USER
char *sql = NULL;
sql = sqlite3_mprintf("%s", "PRAGMA journal_mode = PERSIST");
ret = sqlite3_exec(*handle, sql, NULL, NULL, NULL);
@@ -223,7 +222,6 @@ int mc_db_util_connect(void **handle, uid_t uid)
return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
}
-#endif
return MEDIA_CONTROLLER_ERROR_NONE;
}