Social Eng. extension: massmailer -> calling IO.popen in a secure way

This commit is contained in:
antisnatchor
2012-09-02 19:00:40 +01:00
parent d881852216
commit 31387a0aa6

View File

@@ -222,9 +222,10 @@ EOF
end
def get_mime(file_path)
mime = "file --mime -b #{file_path}"
result = ""
IO.popen(mime.to_s) { |f| result = f.gets.split(";").first }
IO.popen(["file", "--mime","-b", "#{file_path}"], 'r+') do |io|
result = io.readlines.first.split(";").first
end
result
end