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
set_passwords: support for FreeBSD #46
Conversation
migrated from https://code.launchpad.net/~goneri/cloud-init/+git/cloud-init/+merge/368507 from what i understand from @blackboxsw's comment here we still want to have his patch on top of it. |
The best is probably to use @blackboxsw patch directly. |
The www/chpasswd utility which we depended on for FreeBSD installations does *not* do the same thing as the equally named Linux utility. For FreeBSD, we now use the pw(8) utility (which can only process one user at a time) Additionally, we abstract expire passwd into a function, and override it in the FreeBSD distro class.
495ad74
to
db36427
Compare
replaced @goneri's patch with @blackboxsw's. |
failing tests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possible cause for one of the test failures
@@ -179,20 +179,19 @@ def handle(_name, cfg, cloud, log, args): | |||
for line in plist: | |||
u, p = line.split(':', 1) | |||
if prog.match(p) is not None and ":" not in p: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means you can't have a :
in your password
cloudinit/config/cc_set_passwords.py
Outdated
randlist.append("%s:%s" % (u, p)) | ||
plist_in.append("%s:%s" % (u, p)) | ||
randlist.append(line) | ||
plist_in.append(line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not reflected in these lists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this hunk is now reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changeset should resolve that integration test failure
when `hashed` was false, the entire `cmd` is turned into `[]`. Co-Authored-By: Chad Smith <blackboxsw@gmail.com>
huh? i am honestly surprised you're passes now perhaps i need to add a test for random passwords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this work and additional unit tests.
Allow setting of user passwords on FreeBSD The www/chpasswd utility which we depended on for FreeBSD installations does *not* do the same thing as the equally named Linux utility. For FreeBSD, we now use the pw(8) utility (which can only process one user at a time) Additionally, we abstract expire passwd into a function, and override it in the FreeBSD distro class. Co-Authored-By: Chad Smith <chad.smith@canonical.com>
Add FreeBSD support to
cc_set_passwords
.FreeBSD does not come with chpasswd binary, a chpasswd port1 exists
but it's not the same tool than the one from Linux2.
Finally, NetBSD and OpenBSD don't have the chpasswd binary at all, so
an abstraction layer will be needed.