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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 149c1e2722e441af453f1eca0da8bc9f6e639097
4
- data.tar.gz: b7eb2635ebfaf3b7119e1103da9ed96861abd956
3
+ metadata.gz: e4bbeedbd93346478be080cccaa8c690a2dab1d4
4
+ data.tar.gz: 06860c7283922f58de2599abdfed56ded6006b0f
5
5
  SHA512:
6
- metadata.gz: 30dc8b7ac56e049c1e29a71fe7f473ce14c58e4387a61b0b8c5c9206862c09a2a30838ee8d5131c0c8865f37ec955c987d8687a54710c41410736a48c1b0d1fc
7
- data.tar.gz: 3e28985de56c4995daa461278ffaea599c80e6e443f410039971e61410029eaa7c4679d0dbb84cfb82b64a2d95a58999f02423d1804bca885aa290026abe9ff0
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
- "getent passwd #{escape(user)}"
4
+ "id #{escape(user)}"
5
5
  end
6
6
 
7
7
  def check_belongs_to_group(user, group)
8
- "groups #{escape(user)} | grep -- #{escape(group)}"
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
- 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)}"|
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
- auid = "getent passwd #{escape(user)} | cut -f 3 -d ':'"
27
- %Q| test "#{escape(uid)}" -eq "#{escape(auid)}"|
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
- "getent passwd #{escape(user)} | cut -f 3 -d ':'"
50
+ "id -u #{escape(user)}"
53
51
  end
54
52
 
55
53
  def get_gid(user)
56
- "getent passwd #{escape(user)} | cut -f 4 -d ':'"
54
+ "id -g #{escape(user)}"
57
55
  end
58
56
 
59
57
  def get_home_directory(user)
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.82.14"
2
+ VERSION = "2.82.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.82.14
4
+ version: 2.82.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita