GNOME Bugzilla – Bug 767183
Create API to explicitly turn off "session" things for system services that use glib
Last modified: 2018-05-24 18:55:01 UTC
Migrated from https://bugzilla.gnome.org/show_bug.cgi?id=767172
I'm not convinced "session things" is a meaningful set of GLib features.
I can think of two major categories: • Features which allow remote file access (i.e. what’s currently controlled by `GIO_USE_VFS=local` and `GVFS_DISABLE_FUSE=1`) - You want these disabled for system services because typically they only ever need access to the local file system • Anything which implicitly connects to the D-Bus session bus (`GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1`, `GSETTINGS_BACKEND=memory`) - System services shouldn’t connect to the session bus by default I guess this should be an explicit API, because detecting that a program ‘looks like a system service’ is a bit tricky (they might not always run as UID 0; and user services might have systemd units, so the fact a process is spawned by systemd doesn’t necessarily mean it’s a system service). However, a `g_disable_session_things()` API would be a bit rubbish, because nobody’s going to remember to call it. It’s like having to call an explicit API to make your program secure. Two suggestions come to mind: • An equivalent of GApplication (GService?) which handles normal service things (UNIX signals, command line options, grabbing a unique name on the system bus), and ensures ‘session’ things are turned off on startup. • Or a g_set_default_bus(GBusType) API which you call on startup, which switches things (GApplication?) to use the system bus instead of the session bus by default. That would also result in disabling other things (GIO VFSs, GSettings dconf backend, remote volume monitors).
https://github.com/projectatomic/rpm-ostree/pull/312
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1170.