Skip to content

Commit b4b9f1f

Browse files
authored
FUND-2265 FileSystem-document-provider setting SecurityCheckOnFilePath added (#124)
* FileSystem-document-provider setting SecurityCheckOnFilePath added * resolced co-pilot hint * rolback changes
1 parent 90d331b commit b4b9f1f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/OneGround.ZGW.Common/Helpers/TempFileHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.IO;
1+
using System.IO;
22
using System.Security;
33

44
namespace OneGround.ZGW.Common.Helpers;

src/OneGround.ZGW.Documenten.Services.FileSystem/FileSystemDocumentServiceSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ namespace OneGround.ZGW.Documenten.Services.FileSystem;
33
public class FileSystemDocumentServiceSettings
44
{
55
public string DocumentRootPath { get; set; }
6+
public bool SecurityCheckOnFilePath { get; set; } = true;
67
}

src/OneGround.ZGW.Documenten.Services.FileSystem/FileSystemDocumentServices.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ private string GetAbsoluteDocumentPath(DocumentUrn urn)
389389
// Validates if the specified fullFileName is located in the Root folder of the DMS of (FS), like "c:\MyDMS\202503\~1dd9f469-d2a7-4aad-94c6-903367cce815"
390390
private void AssureNotTampered(string fullFileName)
391391
{
392+
if (!Settings.SecurityCheckOnFilePath)
393+
return;
394+
392395
if (fullFileName == null)
393396
return;
394397

0 commit comments

Comments
 (0)