Merge branch 'wip/pwithnall/dbus-system-bus-address' into 'main'

gdbusaddress: Use runstatedir rather than localstatedir

See merge request GNOME/glib!3101
This commit is contained in:
Marco Trevisan 2022-12-06 00:24:17 +00:00
commit 6599cf95ae
5 changed files with 39 additions and 6 deletions

12
NEWS
View File

@ -1,3 +1,15 @@
UNRELEASED CHANGES
==================
* Change the default D-Bus system bus socket address from
`/var/run/dbus/system_bus_socket` to `/run/dbus/system_bus_socket`, in line
with changes in dbus.git. This can now be overridden by passing
`-Druntime_dir=/some/path` at configure time — the default is `/run`, which
should work for all users except distributions where `/run` is not equivalent
to `/var/run`. OS distributors should check that this configured path matches
the runtime directory configured for their D-Bus daemon. (!3101)
Overview of changes in GLib 2.75.0, 2022-11-10 Overview of changes in GLib 2.75.0, 2022-11-10
============================================== ==============================================

View File

@ -1339,8 +1339,10 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
{ {
/* While the D-Bus specification says this must be `/var/run/dbus/system_bus_socket`, /* While the D-Bus specification says this must be `/var/run/dbus/system_bus_socket`,
* a footnote allows it to use localstatedir: * a footnote allows it to use localstatedir:
* https://dbus.freedesktop.org/doc/dbus-specification.html#ftn.id-1.13.6.4.3.3 */ * https://dbus.freedesktop.org/doc/dbus-specification.html#ftn.id-1.13.6.4.3.3
ret = g_strdup ("unix:path=" GLIB_LOCALSTATEDIR "/run/dbus/system_bus_socket"); * or, on systems where /run is the same as /var/run, runstatedir:
* https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/209 */
ret = g_strdup ("unix:path=" GLIB_RUNSTATEDIR "/dbus/system_bus_socket");
} }
break; break;

View File

@ -266,10 +266,12 @@ g_unix_is_mount_path_system_internal (const char *mount_path)
"/var", "/var",
"/var/crash", "/var/crash",
"/var/local", "/var/local",
GLIB_LOCALSTATEDIR,
"/var/log", "/var/log",
"/var/log/audit", /* https://bugzilla.redhat.com/show_bug.cgi?id=333041 */ "/var/log/audit", /* https://bugzilla.redhat.com/show_bug.cgi?id=333041 */
"/var/mail", "/var/mail",
"/var/run", "/var/run",
GLIB_RUNSTATEDIR,
"/var/tmp", /* https://bugzilla.redhat.com/show_bug.cgi?id=335241 */ "/var/tmp", /* https://bugzilla.redhat.com/show_bug.cgi?id=335241 */
"/proc", "/proc",
"/sbin", "/sbin",

View File

@ -123,10 +123,17 @@ else
glib_charsetaliasdir = glib_libdir glib_charsetaliasdir = glib_libdir
endif endif
glib_localstatedir = get_option('localstatedir') glib_localstatedir = glib_prefix / get_option('localstatedir')
if not glib_localstatedir.startswith('/')
# See https://mesonbuild.com/Builtin-options.html#directories if get_option('runtime_dir') != ''
glib_localstatedir = join_paths(glib_prefix, glib_localstatedir) glib_runstatedir = glib_prefix / get_option('runtime_dir')
else
# While wed normally prefix directories like this with, for example,
# glib_localstatedir, `/run` is a bit different in that its for runtime state
# rather than data files, so its typically functionally useless to use a
# prefixed version. No other processes will be using it. So we default to the
# unprefixed system `/run` directory.
glib_runstatedir = '/run'
endif endif
installed_tests_metadir = join_paths(glib_datadir, 'installed-tests', meson.project_name()) installed_tests_metadir = join_paths(glib_datadir, 'installed-tests', meson.project_name())
@ -2110,6 +2117,7 @@ glib_conf.set('HAVE_GETTEXT', 1)
glib_conf.set_quoted('GLIB_LOCALE_DIR', join_paths(glib_datadir, 'locale')) glib_conf.set_quoted('GLIB_LOCALE_DIR', join_paths(glib_datadir, 'locale'))
glib_conf.set_quoted('GLIB_LOCALSTATEDIR', glib_localstatedir) glib_conf.set_quoted('GLIB_LOCALSTATEDIR', glib_localstatedir)
glib_conf.set_quoted('GLIB_RUNSTATEDIR', glib_runstatedir)
# libmount is only used by gio, but we need to fetch the libs to generate the # libmount is only used by gio, but we need to fetch the libs to generate the
# pkg-config file below # pkg-config file below
@ -2450,6 +2458,7 @@ summary({
'includedir' : glib_includedir, 'includedir' : glib_includedir,
'giomodulesdir' : glib_giomodulesdir, 'giomodulesdir' : glib_giomodulesdir,
'localstatedir' : glib_localstatedir, 'localstatedir' : glib_localstatedir,
'runstatedir' : glib_runstatedir,
}, section: 'Directories') }, section: 'Directories')
if get_option('multiarch') if get_option('multiarch')

View File

@ -14,6 +14,14 @@ option('gio_module_dir',
value : '', value : '',
description : 'load gio modules from this directory (default to \'libdir/gio/modules\' if unset)') description : 'load gio modules from this directory (default to \'libdir/gio/modules\' if unset)')
# FIXME: Deliberately not named runstatedir to avoid colliding with
# https://github.com/mesonbuild/meson/issues/4141; port to that when Meson
# supports it
option('runtime_dir',
type: 'string',
value: '',
description: 'Directory for transient runtime state [default: /run]')
option('selinux', option('selinux',
type : 'feature', type : 'feature',
value : 'auto', value : 'auto',