specinfra 2.82.13 → 2.82.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/command/base/user.rb +9 -7
- data/lib/specinfra/version.rb +1 -1
- 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: 149c1e2722e441af453f1eca0da8bc9f6e639097
|
4
|
+
data.tar.gz: b7eb2635ebfaf3b7119e1103da9ed96861abd956
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30dc8b7ac56e049c1e29a71fe7f473ce14c58e4387a61b0b8c5c9206862c09a2a30838ee8d5131c0c8865f37ec955c987d8687a54710c41410736a48c1b0d1fc
|
7
|
+
data.tar.gz: 3e28985de56c4995daa461278ffaea599c80e6e443f410039971e61410029eaa7c4679d0dbb84cfb82b64a2d95a58999f02423d1804bca885aa290026abe9ff0
|
@@ -1,15 +1,17 @@
|
|
1
1
|
class Specinfra::Command::Base::User < Specinfra::Command::Base
|
2
2
|
class << self
|
3
3
|
def check_exists(user)
|
4
|
-
"
|
4
|
+
"getent passwd #{escape(user)}"
|
5
5
|
end
|
6
6
|
|
7
7
|
def check_belongs_to_group(user, group)
|
8
|
-
"
|
8
|
+
"groups #{escape(user)} | grep -- #{escape(group)}"
|
9
9
|
end
|
10
10
|
|
11
11
|
def check_belongs_to_primary_group(user, group)
|
12
|
-
"
|
12
|
+
pgid = "getent passwd #{escape(user)} | cut -f 4 -d ':'"
|
13
|
+
ggid = "getent group #{escape(group)} | cut -f 3 -d ':'"
|
14
|
+
%Q|test "#{escape(pgid)}" -eq "#{escape(ggid)}"|
|
13
15
|
end
|
14
16
|
|
15
17
|
def check_is_system_user(user)
|
@@ -21,8 +23,8 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def check_has_uid(user, uid)
|
24
|
-
|
25
|
-
"
|
26
|
+
auid = "getent passwd #{escape(user)} | cut -f 3 -d ':'"
|
27
|
+
%Q| test "#{escape(uid)}" -eq "#{escape(auid)}"|
|
26
28
|
end
|
27
29
|
|
28
30
|
def check_has_home_directory(user, path_to_home)
|
@@ -47,11 +49,11 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
47
49
|
end
|
48
50
|
|
49
51
|
def get_uid(user)
|
50
|
-
"
|
52
|
+
"getent passwd #{escape(user)} | cut -f 3 -d ':'"
|
51
53
|
end
|
52
54
|
|
53
55
|
def get_gid(user)
|
54
|
-
"
|
56
|
+
"getent passwd #{escape(user)} | cut -f 4 -d ':'"
|
55
57
|
end
|
56
58
|
|
57
59
|
def get_home_directory(user)
|
data/lib/specinfra/version.rb
CHANGED
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.82.
|
4
|
+
version: 2.82.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|