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|
if $config["CAPTURE"]
video_name = "capture-" + "#{}-#{TIME_AT_START}.mkv"
# Sanitize the filename from unix-hostile filename characters
bad_unix_filename_chars ="[\s/]")
video_name.gsub!(bad_unix_filename_chars, '_')
bad_filename_chars ="[^A-Za-z0-9_\\-.,]")
video_name.gsub!(bad_filename_chars, '_')
@video_path = "#{$config['TMPDIR']}/#{video_name}"
capture = IO.popen(['avconv',
'-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