Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-2.15] user action, fix ssh-keygen issues #84168

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Oct 24, 2024

Backport of #84165

User action now avoids conflicts ssh pub key by removing pub key if we are going to generate private added warnings to let user know exactly what happens with existing key files also added tests

CVE-2024-9902


Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) wk.cvs.github@sydorenko.org.ua
Co-authored-by: Sloane Hertel 19572925+s-hertel@users.noreply.github.com
Co-authored-by: Matt Davis 6775756+nitzmahone@users.noreply.github.com

ISSUE TYPE
  • Bugfix Pull Request

Remove pub key if we are going to generate private
fix tests for os X

(cherry picked from commit 11e4a6a)
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. backport This PR does not target the devel branch. module This issue/PR relates to a module. labels Oct 24, 2024
@ansibot
Copy link
Contributor

ansibot commented Oct 24, 2024

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/user.py:1170:121: SyntaxError: self.module.warn(f'Found existing ssh key private file "%s", no force, so skipping ssh-keygen generation' % ssh_key_file)

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/user.py:1170:121: SyntaxError: self.module.warn(f'Found existing ssh key private file "%s", no force, so skipping ssh-keygen generation' % ssh_key_file)

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/user.py:1170:121: traceback: SyntaxError: invalid syntax (at test/lib/ansible_test/_util/target/sanity/import/importer.py:297:0)

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/user.py:1170:121: traceback: SyntaxError: invalid syntax (at test/lib/ansible_test/_util/target/sanity/import/importer.py:297:0)

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/modules/user.py:1170:33: f-string-without-interpolation: Using an f-string that does not have any interpolated variables
lib/ansible/modules/user.py:1175:33: f-string-without-interpolation: Using an f-string that does not have any interpolated variables
lib/ansible/modules/user.py:1178:33: f-string-without-interpolation: Using an f-string that does not have any interpolated variables

click here for bot help

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Oct 24, 2024
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Oct 24, 2024
@mattclay mattclay changed the title user action, fix sshkegen issues [stable-2.15] user action, fix ssh-keygen issues Oct 28, 2024
@mattclay mattclay removed the needs_triage Needs a first human triage before being processed. label Oct 28, 2024
@mattclay mattclay merged commit 0379473 into ansible:stable-2.15 Oct 28, 2024
76 checks passed
@bcoca bcoca deleted the user_sshkey_b4 branch October 28, 2024 17:22
@ansible ansible locked and limited conversation to collaborators Nov 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport This PR does not target the devel branch. bug This issue/PR relates to a bug. module This issue/PR relates to a module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants