mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-29 20:34:11 +02:00
gdbus: Reject attempts to set future connection or server flags
The GDBusConnectionFlags and GDBusServerFlags can affect how we carry out authentication and authorization, either making it more or less restrictive, so it's desirable to "fail closed" if a program is compiled against a new version of GLib but run against an old version. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
@@ -57,6 +57,10 @@
|
||||
|
||||
#include "glibintl.h"
|
||||
|
||||
#define G_DBUS_SERVER_FLAGS_ALL \
|
||||
(G_DBUS_SERVER_FLAGS_RUN_IN_THREAD | \
|
||||
G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS)
|
||||
|
||||
/**
|
||||
* SECTION:gdbusserver
|
||||
* @short_description: Helper for accepting connections
|
||||
@@ -512,6 +516,7 @@ g_dbus_server_new_sync (const gchar *address,
|
||||
|
||||
g_return_val_if_fail (address != NULL, NULL);
|
||||
g_return_val_if_fail (g_dbus_is_guid (guid), NULL);
|
||||
g_return_val_if_fail ((flags & ~G_DBUS_SERVER_FLAGS_ALL) == 0, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
server = g_initable_new (G_TYPE_DBUS_SERVER,
|
||||
|
Reference in New Issue
Block a user