Commit 50bf15c0 authored by anonym's avatar anonym
Browse files

Use a whitelist approach when generating the video filename.

That is, only use known good (vs. unix) characters when converting the
scenario name to a filename.
parent 473f5e20
...@@ -114,8 +114,8 @@ Before('@product') do |scenario| ...@@ -114,8 +114,8 @@ Before('@product') do |scenario|
if $config["CAPTURE"] if $config["CAPTURE"]
video_name = "capture-" + "#{scenario.name}-#{TIME_AT_START}.mkv" video_name = "capture-" + "#{scenario.name}-#{TIME_AT_START}.mkv"
# Sanitize the filename from unix-hostile filename characters # Sanitize the filename from unix-hostile filename characters
bad_unix_filename_chars = Regexp.new("[\s/]") bad_filename_chars = Regexp.new("[^A-Za-z0-9_\\-.,]")
video_name.gsub!(bad_unix_filename_chars, '_') video_name.gsub!(bad_filename_chars, '_')
@video_path = "#{$config['TMPDIR']}/#{video_name}" @video_path = "#{$config['TMPDIR']}/#{video_name}"
capture = IO.popen(['avconv', capture = IO.popen(['avconv',
'-f', 'x11grab', '-f', 'x11grab',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment