Supress 'Permission denied' error in get_suid_files
parent
c7acbc08ab
commit
6040f779c5
|
@ -132,7 +132,8 @@ module System
|
|||
# @param findpath The path on the system to start searching
|
||||
# @return [Array]
|
||||
def get_suid_files(findpath = '/')
|
||||
cmd_exec("find #{findpath} -perm -4000 -print -xdev").to_s.split("\n")
|
||||
out = cmd_exec("find #{findpath} -perm -4000 -print -xdev").to_s.split("\n")
|
||||
out.delete_if {|i| i.include? 'Permission denied'}
|
||||
rescue
|
||||
raise "Could not retrieve all SUID files"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue