specinfra 2.57.2 → 2.57.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/exec.rb +2 -2
- data/lib/specinfra/command/base/user.rb +5 -5
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/base/user_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea6a32d408ee5720f358dc9f52fe186e953899b0
|
4
|
+
data.tar.gz: d13f590f7f81dedb3945db4711ac799389afd583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c0f38b754bb0494d374254d36ec916be0bebb34d73531c9c6d049601b731d8018a7ee9160e47194ee4d94530ddb182be5168b1d61e8947945ee4c4a5b8bd938
|
7
|
+
data.tar.gz: 1ad6f4144626f5c4f435a08290466e35b55e45866411839c681ffbdff848778a08ba4fd5ae80a0ff0221f306e9f682d94444329e91f6b02c815a4ac75cb0da72
|
@@ -122,11 +122,11 @@ module Specinfra
|
|
122
122
|
|
123
123
|
pid = spawn(cmd, :out => out_w, :err => err_w)
|
124
124
|
|
125
|
+
pid, stats = Process.waitpid2(pid)
|
126
|
+
|
125
127
|
out_w.close
|
126
128
|
err_w.close
|
127
129
|
|
128
|
-
pid, stats = Process.waitpid2(pid)
|
129
|
-
|
130
130
|
begin
|
131
131
|
quit_w.syswrite 1
|
132
132
|
rescue Errno::EPIPE
|
@@ -5,7 +5,7 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def check_belongs_to_group(user, group)
|
8
|
-
"id #{escape(user)} | sed 's/ context=.*//g' |
|
8
|
+
"id #{escape(user)} | sed 's/ context=.*//g' | cut -f 4 -d '=' | grep -- #{escape(group)}"
|
9
9
|
end
|
10
10
|
|
11
11
|
def check_belongs_to_primary_group(user, group)
|
@@ -31,11 +31,11 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def get_minimum_days_between_password_change(user)
|
34
|
-
"chage -l #{escape(user)} | grep '^Minimum.*:' |
|
34
|
+
"chage -l #{escape(user)} | grep '^Minimum.*:' | cut -f 2 -d ': '"
|
35
35
|
end
|
36
36
|
|
37
37
|
def get_maximum_days_between_password_change(user)
|
38
|
-
"chage -l #{escape(user)} | grep '^Maximum.*:' |
|
38
|
+
"chage -l #{escape(user)} | grep '^Maximum.*:' | cut -f 2 -d ': '"
|
39
39
|
end
|
40
40
|
|
41
41
|
def get_uid(user)
|
@@ -47,7 +47,7 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def get_home_directory(user)
|
50
|
-
"getent passwd #{escape(user)} |
|
50
|
+
"getent passwd #{escape(user)} | cut -f 6 -d ':'"
|
51
51
|
end
|
52
52
|
|
53
53
|
def get_login_shell(user)
|
@@ -88,7 +88,7 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def get_encrypted_password(user)
|
91
|
-
"getent shadow #{escape(user)} |
|
91
|
+
"getent shadow #{escape(user)} | cut -f 2 -d ':'"
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -11,7 +11,7 @@ describe get_command(:get_user_gid, 'foo') do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
describe get_command(:get_user_home_directory, 'foo') do
|
14
|
-
it { should eq "getent passwd foo |
|
14
|
+
it { should eq "getent passwd foo | cut -f 6 -d ':'" }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe get_command(:update_user_home_directory, 'user', 'dir') do
|
@@ -35,7 +35,7 @@ describe get_command(:update_user_encrypted_password, 'foo', 'xxxxxxxx') do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
describe get_command(:get_user_encrypted_password, 'foo') do
|
38
|
-
it { should eq "getent shadow foo |
|
38
|
+
it { should eq "getent shadow foo | cut -f 2 -d ':'" }
|
39
39
|
end
|
40
40
|
|
41
41
|
describe get_command(:check_user_has_login_shell, 'foo', '/bin/sh') do
|
@@ -43,11 +43,11 @@ describe get_command(:check_user_has_login_shell, 'foo', '/bin/sh') do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
describe get_command(:get_user_minimum_days_between_password_change, 'foo') do
|
46
|
-
it { should eq "chage -l foo | grep '^Minimum.*:' |
|
46
|
+
it { should eq "chage -l foo | grep '^Minimum.*:' | cut -f 2 -d ': '" }
|
47
47
|
end
|
48
48
|
|
49
49
|
describe get_command(:get_user_maximum_days_between_password_change, 'foo') do
|
50
|
-
it { should eq "chage -l foo | grep '^Maximum.*:' |
|
50
|
+
it { should eq "chage -l foo | grep '^Maximum.*:' | cut -f 2 -d ': '" }
|
51
51
|
end
|
52
52
|
|
53
53
|
describe get_command(:get_user_login_shell, 'foo') do
|
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.57.
|
4
|
+
version: 2.57.3
|
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-05-
|
11
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|