aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-04 23:54:00 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-05 00:16:50 -0400
commita99e002cc863c27008a60490cdf76b69b9efb8c1 (patch)
tree05bc3da8d2839c25e25940b925906da52da0d707
parentresolved: treat failure to parse config as non-fatal (diff)
downloadsystemd-a99e002cc863c27008a60490cdf76b69b9efb8c1.tar.gz
systemd-a99e002cc863c27008a60490cdf76b69b9efb8c1.tar.bz2
systemd-a99e002cc863c27008a60490cdf76b69b9efb8c1.zip
basic/log: use getenv instead of secure_getenv
secure_getenv does not work when the process has a nonempty permitted capability set, which means that it's unduly hard to configure logging in systemd-logind, systemd-resolved, and others. secure_getenv is useful for code in libraries which might get called from a setuid application. log_parse_environment() is never called from our library code, but directly form various top-level executables. None of them are installed suid, and none are prepared to be used this way, since many additional changes would be required to make that safe. We may just as well drop the check and allow SYSTEMD_LOG_* to properly parsed. Fixes #4900.
-rw-r--r--src/basic/log.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/basic/log.c b/src/basic/log.c
index e27256499..ab1e6cac1 100644
--- a/src/basic/log.c
+++ b/src/basic/log.c
@@ -1041,19 +1041,19 @@ void log_parse_environment_realm(LogRealm realm) {
user stuff. */
(void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
- e = secure_getenv("SYSTEMD_LOG_TARGET");
+ e = getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target '%s'. Ignoring.", e);
- e = secure_getenv("SYSTEMD_LOG_LEVEL");
+ e = getenv("SYSTEMD_LOG_LEVEL");
if (e && log_set_max_level_from_string_realm(realm, e) < 0)
log_warning("Failed to parse log level '%s'. Ignoring.", e);
- e = secure_getenv("SYSTEMD_LOG_COLOR");
+ e = getenv("SYSTEMD_LOG_COLOR");
if (e && log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool '%s'. Ignoring.", e);
- e = secure_getenv("SYSTEMD_LOG_LOCATION");
+ e = getenv("SYSTEMD_LOG_LOCATION");
if (e && log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool '%s'. Ignoring.", e);
}