Blob Blame History Raw
From dbb348d464c6c63d800039abae1b785f7239d928 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 21 Apr 2020 16:49:02 +0200
Subject: [PATCH] service: set User=root so that gio doesn't have to look into
 /etc/passwd

GVfs' libgvfsdbus.so GIo module, when automatically loaded, attempts to
discover if there's a session D-Bus instance to use. It tries real hard
to get the socket name it would use -- in absence of XDG_RUNTIME_DIR it
decides to make it up with user's home directory. When HOME is unset
too, it just tries to figure it out by looking into /etc/passwd. Which
upsets SELinux that would better not see us looking into it.

We trigger the load of the GIo modules, by using the GFile API to access
the the ports in /dev. They're utterly uesless to us, but there doesn't
seem to be a way to disable their load. Oh well.

For now, let's just ensure HOME is set and the problematic path in glib
is not taken.
---
 data/ModemManager.service.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/data/ModemManager.service.in b/data/ModemManager.service.in
index 8ea5a1f6..7e16d4d0 100644
--- a/data/ModemManager.service.in
+++ b/data/ModemManager.service.in
@@ -7,6 +7,7 @@ BusName=org.freedesktop.ModemManager1
 ExecStart=@sbindir@/ModemManager
 StandardError=null
 Restart=on-abort
+User=root
 
 [Install]
 WantedBy=multi-user.target
-- 
2.26.0