specinfra 2.82.14 → 2.82.15
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 +7 -9
- data/lib/specinfra/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4bbeedbd93346478be080cccaa8c690a2dab1d4
|
4
|
+
data.tar.gz: 06860c7283922f58de2599abdfed56ded6006b0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23d0eb2edb19432f9ffe8dfb8e352a0d60fc6da010e74cfa2b2601554737996444763914c292f854a7b41a492c940400d0fca56cff40a4a62d25eb2f0991c652
|
7
|
+
data.tar.gz: 415baa53796260ae23d3a69414d51b0c7bad7def0483cfdf4afbc96d08a265dc3997e0735c918c579bd7f19d0b2c843c78baf39deaf85b689d68ade76688fabc
|
@@ -1,17 +1,15 @@
|
|
1
1
|
class Specinfra::Command::Base::User < Specinfra::Command::Base
|
2
2
|
class << self
|
3
3
|
def check_exists(user)
|
4
|
-
"
|
4
|
+
"id #{escape(user)}"
|
5
5
|
end
|
6
6
|
|
7
7
|
def check_belongs_to_group(user, group)
|
8
|
-
"
|
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)
|
12
|
-
|
13
|
-
ggid = "getent group #{escape(group)} | cut -f 3 -d ':'"
|
14
|
-
%Q|test "#{escape(pgid)}" -eq "#{escape(ggid)}"|
|
12
|
+
"id -gn #{escape(user)}| grep ^#{escape(group)}$"
|
15
13
|
end
|
16
14
|
|
17
15
|
def check_is_system_user(user)
|
@@ -23,8 +21,8 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
23
21
|
end
|
24
22
|
|
25
23
|
def check_has_uid(user, uid)
|
26
|
-
|
27
|
-
|
24
|
+
regexp = "^uid=#{uid}("
|
25
|
+
"id #{escape(user)} | grep -- #{escape(regexp)}"
|
28
26
|
end
|
29
27
|
|
30
28
|
def check_has_home_directory(user, path_to_home)
|
@@ -49,11 +47,11 @@ class Specinfra::Command::Base::User < Specinfra::Command::Base
|
|
49
47
|
end
|
50
48
|
|
51
49
|
def get_uid(user)
|
52
|
-
"
|
50
|
+
"id -u #{escape(user)}"
|
53
51
|
end
|
54
52
|
|
55
53
|
def get_gid(user)
|
56
|
-
"
|
54
|
+
"id -g #{escape(user)}"
|
57
55
|
end
|
58
56
|
|
59
57
|
def get_home_directory(user)
|
data/lib/specinfra/version.rb
CHANGED