mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 02:21:40 +01:00
When a list of targets is provided (-T), skip empty lines.
This commit is contained in:
parent
cf815a6652
commit
8051078524
@ -573,8 +573,8 @@ class AuditConf:
|
|||||||
with open(aconf.target_file, 'r') as f:
|
with open(aconf.target_file, 'r') as f:
|
||||||
aconf.target_list = f.readlines()
|
aconf.target_list = f.readlines()
|
||||||
|
|
||||||
# Strip out whitespace from each line in target file.
|
# Strip out whitespace from each line in target file, and skip empty lines.
|
||||||
aconf.target_list = [target.strip() for target in aconf.target_list]
|
aconf.target_list = [target.strip() for target in aconf.target_list if target not in ("", "\n")]
|
||||||
|
|
||||||
# If a policy file was provided, validate it.
|
# If a policy file was provided, validate it.
|
||||||
if (aconf.policy_file is not None) and (aconf.make_policy is False):
|
if (aconf.policy_file is not None) and (aconf.make_policy is False):
|
||||||
|
Loading…
Reference in New Issue
Block a user