change alarm-server to non-root user 14/68714/4
authorJiwoong Im <jiwoong.im@samsung.com>
Mon, 9 May 2016 11:15:30 +0000 (20:15 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Fri, 13 May 2016 07:24:23 +0000 (16:24 +0900)
- change alarm-server uid from 'root' to 'app_fw'
- change permission and group of /dev/rtc0 by udev rule

Change-Id: I11dd2a14daff5c9b6b67c4f37708cc2a17f358e1
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
packaging/99-rtc.rules [new file with mode: 0644]
packaging/alarm-manager.spec
packaging/alarm-server.service

diff --git a/packaging/99-rtc.rules b/packaging/99-rtc.rules
new file mode 100644 (file)
index 0000000..79f3cee
--- /dev/null
@@ -0,0 +1 @@
+SUBSYSTEM=="rtc", KERNEL=="rtc0", MODE="0660" GROUP="system_share"
index bca8780..9456eb1 100644 (file)
@@ -6,6 +6,7 @@ Group:      System/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    alarm-server.service
+Source2:    99-rtc.rules
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
@@ -87,6 +88,8 @@ rm -rf %{buildroot}
 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/alarm-server.service
 ln -s ../alarm-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/alarm-server.service
+mkdir -p %{buildroot}%{_libdir}/udev/rules.d
+install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/udev/rules.d
 
 %post -p /sbin/ldconfig
 
@@ -94,10 +97,6 @@ ln -s ../alarm-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/al
 
 %post -n alarm-server
 
-chsmack -a System %{TZ_SYS_DB}/.alarmmgr.db
-chsmack -a System %{TZ_SYS_DB}/.alarmmgr.db-journal
-chown system:system /var/log/alarmmgr.log
-
 %post -n libalarm
 /sbin/ldconfig
 
@@ -113,6 +112,7 @@ chown system:system /var/log/alarmmgr.log
 %attr(0644,root,root) %{_datadir}/dbus-1/system-services/org.tizen.alarm.manager.service
 %license LICENSE
 %config %{_sysconfdir}/dbus-1/system.d/alarm-service.conf
+%{_libdir}/udev/rules.d/99-rtc.rules
 %if 0%{?appfw_feature_alarm_manager_module_log}
 %attr(0755,root,root) %{_sysconfdir}/dump.d/module.d/alarmmgr_log_dump.sh
 %endif
index 7d9a6cd..510fe03 100644 (file)
@@ -3,6 +3,8 @@ Description=Alarm server
 After=system-server.service
 
 [Service]
+User=app_fw
+Group=app_fw
 BusName=org.tizen.alarm.manager
 Type=dbus
 ExecStart=/usr/bin/alarm-server