-
Notifications
You must be signed in to change notification settings - Fork 25
Modified Regex pattern to accept commands besides full executable path. #7
base: master
Are you sure you want to change the base?
Conversation
This will take some time to review due to the holidays. @healingbrew check when you have some time. |
The regex seems to return This is your regex:
This is the current implementation
This is our fault for not writing the tests, but this PR cannot be merged until this is fixed.
So you can either split it up into two regexes ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regex fails to sanitize garbled path arguments such as lorem ipsum cmd.exe dolor
and lorem ipsum C:\cmd.exe dolor
, or any path starting with or containing a non-alphanumeric character.
Oh, thanks. I was totally focused on the "cmd" on tutorial. The cases are very detailed and I'll work on unit tests with them. Thank you. |
I actually couldn't get the format except garbled in |
Out of those examples, the expected outcome would be
|
As of now, the tests pass but the part in quotation marks are accepted with any text inside. I believe it should be something like "command command filename.exe" or if it's specific to warden, "warden command filename.exe". Yet, it's incomplete although all tests pass. |
@healingbrew Hi. I have a question. Let's say I typed something like |
Although it's the default behavior, the regex pattern added with commit 4948bd6 does not accept commands from environment paths, as I have mentioned on issue #6 . So I changed the pattern to accept commands like cmd. Tests are working but they are not ideal solutions, just workarounds. It needs some refactoring yet still capable of esting the condition.