specinfra 2.50.3 → 2.50.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1082ef2fd305ddc91b4e4cdc3f192f249ae8386d
4
- data.tar.gz: 0d339da6567953977b0db27afbc6fad564975067
3
+ metadata.gz: c4a4576e3f89ab971501259a5b2f0d4ff81375da
4
+ data.tar.gz: a44bb834b6ba489e631de9f6e64c4918ed14a58a
5
5
  SHA512:
6
- metadata.gz: 0bb8c1105f0a1761a555ef9e7605e67e6db684c0b34234e2a6f2f4b679f3d155384078ba44b368dc491494d3c24dc04d6732ed37692df87ffbd6f2bf3a63f85b
7
- data.tar.gz: 3356ef0d9ba52a86bc4b9bad7edc33f2db182e8959c56ad08d4fc6a3d289aa0cf9fb33ec0734109dbe2a7b0644ee72a568f015cc6ecd3bf7a013ef0bbc6cd005
6
+ metadata.gz: cd67c47f4d521832d1edbcf6bfa8db9bb8f2829cb0118a1f01a8bd83ff04c76b0e5548a035c2c4250e8dcaf47c3acdf5dd8093509132b88d0fb909a44db8bdcc
7
+ data.tar.gz: 98b9e396f696b18688f1833d0da3bb1a334ce4f6049ab202c13b4799af405c9fb05d4ef0e65c9bff5e6ccaecceda45f4a7d309820f7030fb4f1da31e28460c6a
@@ -9,7 +9,7 @@ class Specinfra::Command::Freebsd::Base::User < Specinfra::Command::Base::User
9
9
  end
10
10
 
11
11
  def get_minimum_days_between_password_change(user)
12
- "echo 0"
12
+ 'echo 0'
13
13
  end
14
14
 
15
15
  def get_maximum_days_between_password_change(user)
@@ -33,22 +33,21 @@ class Specinfra::Command::Freebsd::Base::User < Specinfra::Command::Base::User
33
33
  end
34
34
 
35
35
  def add(user, options)
36
- if options[:password] then
37
- command = ['echo',"\'#{escape(options[:password])}\'",'|','pw','user','add',escape(user),'-H','0']
38
- else
39
- command = ['pw','user','add',escape(user)]
40
- end
36
+ command = ['pw', 'user', 'add', escape(user)]
41
37
  command << '-g' << escape(options[:gid]) if options[:gid]
42
38
  command << '-d' << escape(options[:home_directory]) if options[:home_directory]
43
39
  command << '-s' << escape(options[:shell]) if options[:shell]
44
40
  command << '-m' if options[:create_home]
45
41
  command << '-r' if options[:system_user]
46
42
  command << '-u' << escape(options[:uid]) if options[:uid]
43
+ if options[:password]
44
+ command.concat(['&&', 'chpass', '-p', "\'#{options[:password]}\'", escape(user)])
45
+ end
47
46
  command.join(' ')
48
47
  end
49
48
 
50
49
  def update_encrypted_password(user, encrypted_password)
51
- "echo \'#{escape(encrypted_password)}\' | sudo pw user mod #{escape(user)} -H 0"
50
+ "chpass -p \'#{encrypted_password}\' #{escape(user)}"
52
51
  end
53
52
 
54
53
  def get_encrypted_password(user)
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.50.3"
2
+ VERSION = "2.50.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.50.3
4
+ version: 2.50.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-23 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp