[glib/wip/gdbus-even-when-setcap: 2/3] gdbus: Rename a variable to be less misleading
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gdbus-even-when-setcap: 2/3] gdbus: Rename a variable to be less misleading
- Date: Tue, 2 Feb 2021 20:53:57 +0000 (UTC)
commit 6436d52a0a9a099b345fa39afe64c4c6a49d4c93
Author: Simon McVittie <smcv collabora com>
Date: Tue Feb 2 20:38:41 2021 +0000
gdbus: Rename a variable to be less misleading
We're using "setuid" here as shorthand for any elevated privileges
that should make us distrust the caller: setuid, setgid, filesystem
capabilities, more obscure Linux things that set the AT_SECURE flag
(such as certain AppArmor transitions), and their equivalents on
other operating systems. This is fine if we do it consistently, but
I'm about to add a check for whether we are *literally* setuid,
which would be particularly confusing without a rename.
Signed-off-by: Simon McVittie <smcv collabora com>
gio/gdbusaddress.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
index 6d519a3f4..5dcbf9523 100644
--- a/gio/gdbusaddress.c
+++ b/gio/gdbusaddress.c
@@ -1286,7 +1286,7 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
GCancellable *cancellable,
GError **error)
{
- gboolean is_setuid = GLIB_PRIVATE_CALL (g_check_setuid) ();
+ gboolean has_elevated_privileges = GLIB_PRIVATE_CALL (g_check_setuid) ();
gchar *ret, *s = NULL;
const gchar *starter_bus;
GError *local_error;
@@ -1330,7 +1330,7 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
switch (bus_type)
{
case G_BUS_TYPE_SYSTEM:
- if (is_setuid)
+ if (has_elevated_privileges)
ret = NULL;
else
ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS"));
@@ -1342,7 +1342,7 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
break;
case G_BUS_TYPE_SESSION:
- if (is_setuid)
+ if (has_elevated_privileges)
ret = NULL;
else
ret = g_strdup (g_getenv ("DBUS_SESSION_BUS_ADDRESS"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]