sys_watchdog 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04eeea3b3857c10cbe7f526cef19f61e70a3f1a9
4
- data.tar.gz: aeb32bccdcc12023c32d115fb65cc649ba4cd786
3
+ metadata.gz: a10c3fb98e75f6b640bcf41de55437fcedf53735
4
+ data.tar.gz: db23720ea0270e25649ec0cea220e19d0e1b4cca
5
5
  SHA512:
6
- metadata.gz: 834c320ef7c32cf1a32f83e487f5449aabb69ef4f705df05c44a079318227e48e24502612921be67309237b68aeadf4b1ae8ea0b8bbc8765a7c99a043b2de6a8
7
- data.tar.gz: 770c3478ef82ea91df5cc89bea77207983815dfd171736c8e49f83bcd3a85ac35be56543781b5c943b294f759fa1cc3977379d35104466ead38f4dc618ef57fa
6
+ metadata.gz: f77aede7e1d337816d9b87306faa1c89e4dd736455a498c23e72231dc34f25bf0df8eb3673e8167dee27452e1004c6d66d7cce0a774b5cc45ec642cfb3ebf639
7
+ data.tar.gz: 83e9371c034b7ccb59ce4186aff34b23fb87f2d666e17a076a3774b9cf6791b77ea7705ab94ee5d341b92c594ce68ec63d76e2bdfcd413eece3969c836b9c4dc
@@ -7,3 +7,8 @@ end
7
7
  def log_ex e
8
8
  STDERR.puts e.desc
9
9
  end
10
+
11
+ def match_root_or_current_user stat
12
+ (stat.uid == 0 and stat.gid == 0) or
13
+ (stat.uid == Process.uid and stat.gid == Process.gid)
14
+ end
@@ -60,8 +60,7 @@ class SysWatchdog
60
60
  raise "Conf file #{conf_file} must have mode 0600. Aborting."
61
61
  end
62
62
 
63
- unless (conf_stat.uid == 0 and conf_stat.gid == 0) or
64
- (conf_stat.uid == Process.uid and conf_stat.gid == Process.gid)
63
+ unless match_root_or_current_user(conf_stat)
65
64
  raise "Conf file #{conf_file} must have uid/gid set to root or to current running uid/gid. Aborting."
66
65
  end
67
66
  end
data/sys_watchdog.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sys_watchdog"
3
- s.version = "0.1.3"
3
+ s.version = "0.1.4"
4
4
  s.authors = ["Tom Lobato"]
5
5
  s.email = "lobato@bettercall.io"
6
6
  s.homepage = "http://sys-watchdog.bettercall.io/"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys_watchdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato