Use ===
parent
ad3e37fda2
commit
ccd0a06353
|
@ -19,7 +19,7 @@ module Priv
|
||||||
def is_root?
|
def is_root?
|
||||||
id = cmd_exec('id')
|
id = cmd_exec('id')
|
||||||
uid = id.scan(/uid=(\d+)(.+)/).flatten.first
|
uid = id.scan(/uid=(\d+)(.+)/).flatten.first
|
||||||
if uid =~ /^0$/
|
if /^0$/ === uid
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue