dyndnsd 2.1.0 → 2.1.1

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
  SHA256:
3
- metadata.gz: 52b78d9faf8be67cd76202d2f6060ee5f6b96c382603d7431f906a5b03b3c468
4
- data.tar.gz: 889f266280f47c44418fca138d5253f1eaee7ef5ab79555d96e76b455d74d029
3
+ metadata.gz: db179e252883aaa67b13141d717f4b05fbf94855cca48818e7c21fad127f660a
4
+ data.tar.gz: 35c7ceb2ebfa157672e3c40c93309170effa583e46acd4ad94526a918235a7e7
5
5
  SHA512:
6
- metadata.gz: 72c3cb12a042ebbc9c5ccb8ee00d6278165e5f25acc00e0666793e9ed0bae8bffbcb9057b63fbf7d4ed22c696fee664ce0ffd872c554042ec098437df6853181
7
- data.tar.gz: 44dae96b17ce80eaf60de42bf5ae30444b911659c779182598bd06ce5d936db55d672c5c1b846deb76e911752b81b2613ae3d5eebb4d823631deb49ca4473f29
6
+ metadata.gz: e34cb6fa4efea78da85206ba61dacfc0420121aab94bce8eb63f0947b2c0fded6b2b8cd886bda5b2d29e88a96a93ad035ea0783fa8f83683073607d6a1ebd5df
7
+ data.tar.gz: 2c50826bb39c0e043cdb6905fb2e9c5dea43bd2169045c7aba6cb095e02e84349005f2108fefb3b06d265ee5329759c31cf1475799d5c83616d93a4bbb6679e7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.1 (March 1, 2020)
4
+
5
+ IMPROVEMENTS:
6
+
7
+ - Fix potential `nil` cases detected by [Sorbet](https://sorbet.org) including refactorings
8
+
3
9
  ## 2.1.0 (March 1, 2020)
4
10
 
5
11
  IMPROVEMENTS:
data/lib/dyndnsd.rb CHANGED
@@ -112,8 +112,14 @@ module Dyndnsd
112
112
 
113
113
  # drop priviliges as soon as possible
114
114
  # NOTE: first change group than user
115
- Process::Sys.setgid(Etc.getgrnam(config['group']).gid) if config['group']
116
- Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
115
+ if config['group']
116
+ group = Etc.getgrnam(config['group'])
117
+ Process::Sys.setgid(group.gid) if group
118
+ end
119
+ if config['user']
120
+ user = Etc.getpwnam(config['user'])
121
+ Process::Sys.setuid(user.uid) if user
122
+ end
117
123
 
118
124
  setup_traps
119
125
 
@@ -15,7 +15,7 @@ module Dyndnsd
15
15
  # @return [void]
16
16
  def load
17
17
  if File.file?(@db_file)
18
- @db = JSON.parse(File.open(@db_file, 'r', &:read))
18
+ @db = JSON.parse(File.read(@db_file, mode: 'r'))
19
19
  else
20
20
  @db = {}
21
21
  end
@@ -57,7 +57,7 @@ module Dyndnsd
57
57
  'error.kind': e.class.to_s,
58
58
  'error.object': e,
59
59
  message: e.message,
60
- stack: e.backtrace.join("\n")
60
+ stack: e.backtrace&.join("\n") || ''
61
61
  )
62
62
  raise
63
63
  ensure
@@ -14,7 +14,7 @@ module Dyndnsd
14
14
  # @return [void]
15
15
  def update(db)
16
16
  Helper.span('updater_update') do |span|
17
- span.set_tag('dyndnsd.updater.name', self.class.name.split('::').last)
17
+ span.set_tag('dyndnsd.updater.name', self.class.name&.split('::')&.last || 'None')
18
18
 
19
19
  # write zone file in bind syntax
20
20
  File.open(@zone_file, 'w') { |f| f.write(@generator.generate(db)) }
@@ -24,7 +24,7 @@ module Dyndnsd
24
24
  end
25
25
 
26
26
  # detach so children don't become zombies
27
- Process.detach(pid)
27
+ Process.detach(pid) if pid
28
28
  end
29
29
  end
30
30
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Dyndnsd
3
- VERSION = '2.1.0'.freeze
3
+ VERSION = '2.1.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndnsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Nicolai