diff --git a/unreleased_changes/8720.md b/unreleased_changes/8720.md new file mode 100644 index 00000000000..5e4adb50845 --- /dev/null +++ b/unreleased_changes/8720.md @@ -0,0 +1,2 @@ +### Fixed +- Fixed a bug where the checks on relative paths were too strict when editing dataset settings. diff --git a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/DataSourceService.scala b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/DataSourceService.scala index a313a99405d..0db71b5a843 100644 --- a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/DataSourceService.scala +++ b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/DataSourceService.scala @@ -226,7 +226,10 @@ class DataSourceService @Inject()( val uri = new URI(pathStr) if (DataVaultService.isRemoteScheme(uri.getScheme)) true else { - val path = Path.of(new URI(pathStr).getPath).normalize().toAbsolutePath + val path = organizationDir + .resolve(dataSource.id.directoryName) + .resolve(Path.of(new URI(pathStr).getPath).normalize()) + .toAbsolutePath val allowedParent = organizationDir.toAbsolutePath if (path.startsWith(allowedParent)) true else false }