mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
30 lines
1.7 KiB
Plaintext
30 lines
1.7 KiB
Plaintext
$NetBSD: patch-ae,v 1.4 2015/08/17 13:20:43 fhajny Exp $
|
|
|
|
Fix detection of useradd user management under NetBSD.
|
|
|
|
NetBSD doesn't have chage but can use the -e and -f flags to passwd to
|
|
achieve the same.
|
|
|
|
--- lib/puppet/provider/user/useradd.rb.orig 2015-08-14 08:28:22.481468919 +0000
|
|
+++ lib/puppet/provider/user/useradd.rb
|
|
@@ -9,13 +9,16 @@ Puppet::Type.type(:user).provide :userad
|
|
install Ruby's shadow password library (often known as `ruby-libshadow`)
|
|
if you wish to manage user passwords."
|
|
|
|
- commands :add => "useradd", :delete => "userdel", :modify => "usermod", :password => "chage"
|
|
+ commands :add => "useradd", :delete => "userdel", :modify => "usermod", :password => "chage" unless %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
+ commands :add => "useradd", :delete => "userdel", :modify => "usermod", :password => "passwd" if %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
|
|
options :home, :flag => "-d", :method => :dir
|
|
options :comment, :method => :gecos
|
|
options :groups, :flag => "-G"
|
|
- options :password_min_age, :flag => "-m", :method => :sp_min
|
|
- options :password_max_age, :flag => "-M", :method => :sp_max
|
|
+ options :password_min_age, :flag => "-m", :method => :sp_min unless %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
+ options :password_max_age, :flag => "-M", :method => :sp_max unless %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
+ options :password_min_age, :flag => "-e" if %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
+ options :password_max_age, :flag => "-f" if %w{NetBSD}.include? Facter.value(:operatingsystem)
|
|
options :password, :method => :sp_pwdp
|
|
options :expiry, :method => :sp_expire,
|
|
:munge => proc { |value|
|