Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Allow for changing user passwords #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dudefellah
Copy link

This PR should allow for both the creation and update of Samba user passwords. In addition, it stores sensitive passwords in temporary files instead of printing them out on the command line where they could be seen in a process listing.

@mkfrey
Copy link

mkfrey commented Aug 22, 2020

I like this pull request. This also solves the no_log problem in the pdbedit command exection (and therefore #53) and also does not cause accidential variable expansion when the password contains $ characters.

copy:
content: |
{{ user.password }}
{{ user.password }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentionally the same thing twice?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. As you can see from the shell command later, the contents of this file are just catted into smbpasswd. smbpasswd asks for the password and then password confirmation right after, so we need to enter it twice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a comment to that effect to prevent someone "fixing" it in the future :)

---
- block:
- name: Create tmpfile
tempfile:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be cleaner (and arguably more secure) to use tempfile for this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow? The tempfile module is being used here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I was looking at something else and got confused - you're right of course.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants