From 54072b6632d4cd5c58eca0769573e06c416d8b79 Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 2 Jul 2021 16:09:40 +0530 Subject: [PATCH] cc: Make whitespace-only a valid input for ransomware target directory paths --- .../configuration-components/ValidationFormats.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js index d7b30c13a..e03519c5d 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js @@ -1,10 +1,10 @@ const ipRegex = '((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' const cidrNotationRegex = '([0-9]|1[0-9]|2[0-9]|3[0-2])' const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*)$' -// path starts with `/` OR `$` -const linuxDirRegex = '^/|^\\$' -// path starts like `C:\` OR `C:/` OR `$` OR `%abc%` -const windowsDirRegex = '^([A-Za-z]:(\\\\|\\/))|^\\$|^(%\\w*\\d*\\s*%)' +// path is empty, or starts with `/` OR `$` +const linuxDirRegex = '(^\\s*$)|^/|^\\$' +// path is empty, or starts like `C:\` OR `C:/` OR `$` OR `%abc%` +const windowsDirRegex = '(^\\s*$)|^([A-Za-z]:(\\\\|\\/))|^\\$|^(%\\w*\\d*\\s*%)' export const IP_RANGE = 'ip-range';