-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from nextcloud/bugfix/noid/fix-negative-file-…
…name-match fix(filename): Exclude part/transfer files from checks
- Loading branch information
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Author | ||
Background: | ||
Given user "test1" exists | ||
Given as user "test1" | ||
And using new dav path | ||
|
||
Scenario: Creating file with negative name match | ||
Given user "admin" creates global flow with 200 | ||
| name | Admin flow | | ||
| class | OCA\FilesAccessControl\Operation | | ||
| entity | OCA\WorkflowEngine\Entity\File | | ||
| events | [] | | ||
| operation | deny | | ||
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "!matches", "value": "\/\\.notexe$\/i"} | | ||
| checks-1 | {"class":"OCA\\WorkflowEngine\\Check\\FileMimeType", "operator": "matches", "value": "\/^application\\\/(octet-stream\|x-ms-dos-executable\|x-msi\|x-msdos-program)$\/i"} | | ||
And User "test1" uploads file "data/dosexecutable.exe" to "/definitely.notexe" | ||
Then The webdav response should have a status code "201" | ||
And User "test1" uploads file "data/dosexecutable.exe" to "/definitely.exe" | ||
Then The webdav response should have a status code "403" | ||
Then User "test1" sees no files in the trashbin | ||
|