diff options
author | Igor Galić <me+github@igalic.co> | 2019-12-12 21:04:54 +0100 |
---|---|---|
committer | Daniel Watkins <oddbloke@ubuntu.com> | 2019-12-12 15:04:54 -0500 |
commit | e2840f1771158748780a768f6bfbb117cd7610c6 (patch) | |
tree | edfae615ef2470d11b5d4cd582474713aa1800ac /cloudinit/distros | |
parent | 796f58081766c51cdb36e770541d32f84f595371 (diff) | |
download | vyos-cloud-init-e2840f1771158748780a768f6bfbb117cd7610c6.tar.gz vyos-cloud-init-e2840f1771158748780a768f6bfbb117cd7610c6.zip |
fix unlocking method on FreeBSD
on FreeBSD, `lock_passwd` is implemented as `pw usermod <user> -h -`
This does not lock the account. It prompts for a password change on the console during cloud-init run.
To lock an account, we have to execute: `pw lock <name>`
LP: #1854594
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/freebsd.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index 8e5ae96c..caad1afb 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -256,7 +256,7 @@ class Distro(distros.Distro): def lock_passwd(self, name): try: - util.subp(['pw', 'usermod', name, '-h', '-']) + util.subp(['pw', 'lock', name]) except Exception as e: util.logexc(LOG, "Failed to lock user %s", name) raise e |