summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/dbus-common.c2
-rw-r--r--src/shared/log.c24
2 files changed, 13 insertions, 13 deletions
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index da2dc2e983..8d7c4620ce 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -121,7 +121,7 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *_private, DBusError
* try via XDG_RUNTIME_DIR first, then
* fallback to normal bus access */
- e = getenv("XDG_RUNTIME_DIR");
+ e = __secure_getenv("XDG_RUNTIME_DIR");
if (e) {
char *p;
diff --git a/src/shared/log.c b/src/shared/log.c
index 1cbc9d6250..4fc430eed1 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -688,21 +688,21 @@ int log_set_max_level_from_string(const char *e) {
void log_parse_environment(void) {
const char *e;
- if ((e = getenv("SYSTEMD_LOG_TARGET")))
- if (log_set_target_from_string(e) < 0)
- log_warning("Failed to parse log target %s. Ignoring.", e);
+ e = __secure_getenv("SYSTEMD_LOG_TARGET");
+ if (e && log_set_target_from_string(e) < 0)
+ log_warning("Failed to parse log target %s. Ignoring.", e);
- if ((e = getenv("SYSTEMD_LOG_LEVEL")))
- if (log_set_max_level_from_string(e) < 0)
- log_warning("Failed to parse log level %s. Ignoring.", e);
+ e = __secure_getenv("SYSTEMD_LOG_LEVEL");
+ if (e && log_set_max_level_from_string(e) < 0)
+ log_warning("Failed to parse log level %s. Ignoring.", e);
- if ((e = getenv("SYSTEMD_LOG_COLOR")))
- if (log_show_color_from_string(e) < 0)
- log_warning("Failed to parse bool %s. Ignoring.", e);
+ e = __secure_getenv("SYSTEMD_LOG_COLOR");
+ if (e && log_show_color_from_string(e) < 0)
+ log_warning("Failed to parse bool %s. Ignoring.", e);
- if ((e = getenv("SYSTEMD_LOG_LOCATION")))
- if (log_show_location_from_string(e) < 0)
- log_warning("Failed to parse bool %s. Ignoring.", e);
+ e = __secure_getenv("SYSTEMD_LOG_LOCATION");
+ if (e && log_show_location_from_string(e) < 0)
+ log_warning("Failed to parse bool %s. Ignoring.", e);
}
LogTarget log_get_target(void) {