Creation of the user account for the SDK 92/35592/3 accepted/tizen/3.0.2014.q4/common/20150225.092028 accepted/tizen/common/20150225.091851 submit/tizen_3.0.2014.q4_common/20150224.151135 submit/tizen_common/20150224.141123
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 18 Feb 2015 15:42:28 +0000 (16:42 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Thu, 19 Feb 2015 08:25:24 +0000 (09:25 +0100)
This replace the previously hackish creation of the
user handled by SDB for the SDK.

The current implementation creates the user on need at
installation time of SDB. If the user still exists, it
is not recreated to avoid erasing of previously existing
data.

The group developer is also created.
TODO: check that the group developer is needed.

Change-Id: Ie2a1fae481ad7f89f8349aafa1d19f858b8a1313
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
packaging/sdbd.spec

index 70a5f0d..700451e 100644 (file)
@@ -47,11 +47,16 @@ mkdir -p %{buildroot}%{_prefix}/sbin
 install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/
 
 
-%post 
-mkdir -p /home/developer/.applications
-chown -R developer:users /home/developer/
-chsmack -a "User" /home/developer/
-chsmack -a "User" /home/developer/.applications
+%post
+. %{_sysconfdir}/tizen-platform.conf
+if ! getent passwd "${TZ_SDK_USER_NAME}" > /dev/null; then
+  rm -rf "${TZ_SDK_HOME}"
+  useradd -u 5100 -s /bin/false -m -d "${TZ_SDK_HOME}" "${TZ_SDK_USER_NAME}"
+  getent group developer > /dev/null || groupadd -g 5100 developer
+  for x in app_logging crash developer; do
+    usermod -a -G app_logging "${TZ_SDK_USER_NAME}"
+  done
+fi
 
 %files
 %manifest sdbd.manifest