diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-08-23 18:47:01 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-03 18:59:04 -0700 |
commit | 88fae6e0441d4195e089434f07d3e7fd811d6297 (patch) | |
tree | f5117932fa7dbf0e7cec4a11d01b87ca521623aa /src/core/dbus.c | |
parent | fe1fed02c7637a2c18cd575f78be7fda27972148 (diff) |
shared: in code that might get called from suid programs use __secure_getenv() rather than getenv()
It's better to be safe than sorry.
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r-- | src/core/dbus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c index 9db172b6e6..1fc714823e 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -955,12 +955,12 @@ static DBusConnection* manager_bus_connect_private(Manager *m, DBusBusType type) switch (type) { case DBUS_BUS_SYSTEM: - address = getenv("DBUS_SYSTEM_BUS_ADDRESS"); + address = __secure_getenv("DBUS_SYSTEM_BUS_ADDRESS"); if (!address || !address[0]) address = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS; break; case DBUS_BUS_SESSION: - address = getenv("DBUS_SESSION_BUS_ADDRESS"); + address = __secure_getenv("DBUS_SESSION_BUS_ADDRESS"); if (!address || !address[0]) address = DBUS_SESSION_BUS_DEFAULT_ADDRESS; break; @@ -1077,7 +1077,7 @@ static int bus_init_private(Manager *m) { const char *e; char *p; - e = getenv("XDG_RUNTIME_DIR"); + e = __secure_getenv("XDG_RUNTIME_DIR"); if (!e) return 0; |