mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-20 02:08:34 +08:00
rtemstoolkit: Filter mail options from log output
This filters mail-related options out before logging the command line options. This is needed to prevent leaking potentially sensitive information via logs and emails. Updates #4384
This commit is contained in:

committed by
Joel Sherrill

parent
1a575af817
commit
92f7f67297
@@ -508,7 +508,22 @@ class command_line(object):
|
||||
return None
|
||||
|
||||
def log_info(self):
|
||||
log.output(log.info(self.argv))
|
||||
# Filter potentially sensitive mail options out.
|
||||
filtered_args = [
|
||||
arg for arg in self.argv
|
||||
if all(
|
||||
smtp_opt not in arg
|
||||
for smtp_opt in [
|
||||
'--smtp-host',
|
||||
'--mail-to',
|
||||
'--mail-from',
|
||||
'--smtp-user',
|
||||
'--smtp-password',
|
||||
'--smtp-port'
|
||||
]
|
||||
)
|
||||
]
|
||||
log.output(log.info(filtered_args))
|
||||
|
||||
def load(opts):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user