prevent cloudinit/config/cc_ssh_authkey_fingerprints.py from creating home when "no_create_home: true", or "system: true"#1343
Merged
Conversation
… home when "no_create_home: true", or "system: true"
TheRealFalcon
suggested changes
Mar 24, 2022
Contributor
TheRealFalcon
left a comment
There was a problem hiding this comment.
Thanks @jf , this looks good to me.
I put together a quick integration test. Would you mind adding it to the end of tests/integration_tests/modules/test_ssh_auth_key_fingerprints.py?
@pytest.mark.user_data(
"""\
#cloud-config
users:
- default
- name: nch
no_create_home: true
- name: system
system: true
"""
)
def test_no_home_directory_created(client: IntegrationInstance):
"""Ensure cc_ssh_authkey_fingerprints doesn't create user directories"""
home_output = client.execute("ls /home")
assert "nch" not in home_output
assert "system" not in home_output
passwd = client.execute("cat /etc/passwd")
assert "nch:" in passwd
assert "system:" in passwd
Contributor
Author
|
thank you, @TheRealFalcon . This is done now. Btw, I did end up working on the situation mentioned in the last paragraph: This is done in #1347 |
Contributor
|
Sorry, forgot to specify the import. Thanks for fixing that. |
Contributor
Author
sure. Thanks for the testing code! I didn't really know how to start on that... |
This was referenced May 12, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Commit Message
prevent cc_ssh_authkey_fingerprints.py from inadvertently creating a home when "no_create_home: true", or "system: true"
Additional Context
Test Steps
sample user data:
Checklist: