diff --git a/CHANGELOG.md b/CHANGELOG.md index 4afd2383a..8ec007fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,11 +56,13 @@ To be released on Jun 30, 2020. - [#1576][1576] Add `executable=` argument to `ELF.search` - [#1584][1584] Add `jmp_esp`/`jmp_rsp` attribute to `ROP` +- [#1592][1592] Fix over-verbose logging of process() environment - [#1593][1593] Colorize output of `pwn template` - [#1601][1601] Add `pwn version` command line tool [1576]: https://github.com/Gallopsled/pwntools/pull/1576 [1584]: https://github.com/Gallopsled/pwntools/pull/1584 +[1592]: https://github.com/Gallopsled/pwntools/pull/1592 [1593]: https://github.com/Gallopsled/pwntools/pull/1593 [1601]: https://github.com/Gallopsled/pwntools/pull/1601 diff --git a/pwnlib/tubes/process.py b/pwnlib/tubes/process.py index 34a4eb0b0..3a503d630 100644 --- a/pwnlib/tubes/process.py +++ b/pwnlib/tubes/process.py @@ -242,6 +242,9 @@ def __init__(self, argv = None, #: :class:`subprocess.Popen` object that backs this process self.proc = None + # We need to keep a copy of the un-_validated environment for printing + original_env = env + if shell: executable_val, argv_val, env_val = executable, argv, env else: @@ -298,7 +301,7 @@ def __init__(self, argv = None, if self.isEnabledFor(logging.DEBUG): if argv != [self.executable]: message += ' argv=%r ' % self.argv - if env not in (os.environ, None): message += ' env=%r ' % self.env + if original_env not in (os.environ, None): message += ' env=%r ' % self.env with self.progress(message) as p: