lib/sys_watchdog/main.rb in sys_watchdog-0.1.3 vs lib/sys_watchdog/main.rb in sys_watchdog-0.1.4
- old
+ new
@@ -58,11 +58,10 @@
unless conf_stat.mode.to_s(8) =~ /0600$/
raise "Conf file #{conf_file} must have mode 0600. Aborting."
end
- unless (conf_stat.uid == 0 and conf_stat.gid == 0) or
- (conf_stat.uid == Process.uid and conf_stat.gid == Process.gid)
+ unless match_root_or_current_user(conf_stat)
raise "Conf file #{conf_file} must have uid/gid set to root or to current running uid/gid. Aborting."
end
end
def run_test test, after_restore: false