From 5202337f133c23846acaa6caf255db377e4f18b6 Mon Sep 17 00:00:00 2001 From: Sebastian Philipp Date: Mon, 30 Jan 2023 15:34:54 +0100 Subject: [PATCH] fix(10-042): make changes in audit_ssh_authorizedkeys compatible with python2.7 --- plugins/modules/audit_ssh_authorizedkeys.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/modules/audit_ssh_authorizedkeys.py b/plugins/modules/audit_ssh_authorizedkeys.py index db49aef..93668f9 100644 --- a/plugins/modules/audit_ssh_authorizedkeys.py +++ b/plugins/modules/audit_ssh_authorizedkeys.py @@ -152,7 +152,8 @@ def run_module(): line = line.split('#', 1)[0].strip() if not line: continue - db, *backends = line.split() + tokens = line.split() + db, backends = tokens[0], tokens[1:] if db != 'passwd:': continue for backend in backends: @@ -197,7 +198,7 @@ def run_module(): module.fail_json(msg='SSHD configuration invalid (or insufficient privileges, try become_user=root become=yes)', **result) for cline in sshd_stdout.decode().splitlines(): - conf = cline.split(maxsplit=1) + conf = cline.split(None, 1) if conf[0] == 'authorizedkeyscommand' and conf[1] != 'none': msg = 'AuthorizedKeysCommand is configured: "{}". Keys returned by this command are not audited.'.format(conf[1]) warnings.append(msg)