After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767183 - Create API to explicitly turn off "session" things for system services that use glib
Create API to explicitly turn off "session" things for system services that u...
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-06-03 01:03 UTC by Colin Walters
Modified: 2018-05-24 18:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Walters 2016-06-03 01:03:22 UTC
Migrated from
https://bugzilla.gnome.org/show_bug.cgi?id=767172
Comment 1 Matthias Clasen 2016-06-03 01:13:11 UTC
I'm not convinced "session things" is a meaningful set of GLib features.
Comment 2 Philip Withnall 2016-06-03 10:24:11 UTC
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).
Comment 3 Colin Walters 2016-06-09 13:27:06 UTC
https://github.com/projectatomic/rpm-ostree/pull/312
Comment 4 GNOME Infrastructure Team 2018-05-24 18:55:01 UTC
-- 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.