lightmediascanner: change db directory 51/21651/8
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 23 May 2019 16:06:38 +0000 (18:06 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 19 Jun 2019 13:05:28 +0000 (13:05 +0000)
Lightmediascanner runs for one user and should not be able
to look over the the shoulder of other users. So it should
not run as root anymore.

At the moment, lightmediascanner is a user daemon started in the
user session by systemd, without capabilities but with the Smack
label "System".

To allow the service-mediascanner to access its database,
the db must be set in a specific place with the User::App-shared
label.

Bug-AGL: SPEC-1016

Change-Id: Id4546e2567c4f5a0a5139d274d35d11e4879e42e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
meta-agl-profile-core/recipes-multimedia/lightmediascanner/files/lightmediascanner.service

index e53b247..3b8a6d3 100644 (file)
@@ -4,7 +4,8 @@ Description=Lightmediascanner (LMS)
 [Service]
 Type=dbus
 BusName=org.lightmediascanner
-ExecStart=/usr/bin/lightmediascannerd --startup-scan --db-path=/tmp/%U/lightmediascannerd.db --directory=/media --directory=%h/Music --directory=%h/Videos
+UMask=0077
+ExecStart=/usr/bin/lightmediascannerd --startup-scan --db-path=/run/user/%U/usrshr/lightmediascannerd.db --directory=/media --directory=%h/Music --directory=%h/Videos
 
 [Install]
 WantedBy=default.target