From b2cdeb7a94cd1051a05d9de9a34bfbb54dd1a1df Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Tue, 20 Mar 2018 15:44:59 +0100
Subject: [PATCH 2/3] sanitize path when saving booth config files
---
pcsd/pcsd_file.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pcsd/pcsd_file.rb b/pcsd/pcsd_file.rb
index de7d3553..4f1604a8 100644
--- a/pcsd/pcsd_file.rb
+++ b/pcsd/pcsd_file.rb
@@ -104,6 +104,11 @@ module PcsdFile
if @file[:name].empty?
raise PcsdExchangeFormat::Error.for_item('file', @id, "'name' is empty")
end
+ if @file[:name].include?('/')
+ raise PcsdExchangeFormat::Error.for_item(
+ 'file', @id, "'name' cannot contain '/'"
+ )
+ end
end
def dir()
--
2.13.6