mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-06-26 12:30:18 +02:00
dyndnsd: handle potential nil cases detected by sorbet
- including review suggestions from @jgraichen
This commit is contained in:
@ -112,8 +112,14 @@ module Dyndnsd
|
||||
|
||||
# drop priviliges as soon as possible
|
||||
# NOTE: first change group than user
|
||||
Process::Sys.setgid(Etc.getgrnam(config['group']).gid) if config['group']
|
||||
Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
|
||||
if config['group']
|
||||
group = Etc.getgrnam(config['group'])
|
||||
Process::Sys.setgid(group.gid) if group
|
||||
end
|
||||
if config['user']
|
||||
user = Etc.getpwnam(config['user'])
|
||||
Process::Sys.setuid(user.uid) if user
|
||||
end
|
||||
|
||||
setup_traps
|
||||
|
||||
|
Reference in New Issue
Block a user