From 6f15cddfbc2b860e4153ef452c0dc276ad293995 Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 16 Aug 2018 07:59:59 +0200 Subject: [PATCH] Don't pollute WSGI environ with OS environ --- config | 3 --- radicale/__init__.py | 7 ++----- radicale/config.py | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/config b/config index 0cdc0b5..990aa62 100644 --- a/config +++ b/config @@ -128,9 +128,6 @@ # Set the logging level to debug #debug = False -# Store all environment variables (including those set in the shell) -#full_environment = False - # Don't include passwords in logs #mask_passwords = True diff --git a/radicale/__init__.py b/radicale/__init__.py index b148b49..c0e9cba 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -206,6 +206,8 @@ class ThreadedHTTPSServer(socketserver.ThreadingMixIn, HTTPSServer): class ServerHandler(wsgiref.simple_server.ServerHandler): + # Don't pollute WSGI environ with OS environment + os_environ = {} def log_exception(self, exc_info): logger.error("An exception occurred during request: %s", @@ -269,11 +271,6 @@ class Application: """Sanitize headers for logging.""" request_environ = dict(environ) - # Remove environment variables - if not self.configuration.getboolean("logging", "full_environment"): - for shell_variable in os.environ: - request_environ.pop(shell_variable, None) - # Mask passwords mask_passwords = self.configuration.getboolean( "logging", "mask_passwords") diff --git a/radicale/config.py b/radicale/config.py index f5a9090..fa911fd 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -178,10 +178,6 @@ INITIAL_CONFIG = OrderedDict([ "help": "print debug information", "aliases": ["-D", "--debug"], "type": bool}), - ("full_environment", { - "value": "False", - "help": "store all environment variables", - "type": bool}), ("mask_passwords", { "value": "True", "help": "mask passwords in logs",