From a7d15a24659770b0fa9f4cd26fc7bbb17765cbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 11 Jan 2022 13:36:39 +0100 Subject: nss: only read logging config from environment variables log_parse_environment() uses should_parse_proc_cmdline() to determine whether it should parse settings from the kernel command line. But the checks that should_parse_proc_cmdline() apply to the whole process, and we could get a positive answer also when log_parse_environment() was called from one of the nss modules. In case of nss-modules, we don't want to look at the kernel command line. log_parse_environment_variables() that only looks at the environment variables is split out and used in the nss modules. Fixes #22020. --- src/nss-mymachines/nss-mymachines.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nss-mymachines') diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 781fd48d72..c64e79bdff 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -24,7 +24,7 @@ static void setup_logging_once(void) { static pthread_once_t once = PTHREAD_ONCE_INIT; - assert_se(pthread_once(&once, log_parse_environment) == 0); + assert_se(pthread_once(&once, log_parse_environment_variables) == 0); } #define NSS_ENTRYPOINT_BEGIN \ -- cgit v1.2.1