fix: incorrect access control in public directory shares via rule path rebasing

This commit is contained in:
Henrique Dias committed 2026-06-03 10:24:05 +02:00
1 parent 0d3eb9bea9
commit e07c59df0b
3 files changed
+126

No files matched your search

+5
View File
@@ -67,6 +67,11 @@ var withHashFile = func(fn handleFunc) handleFunc {
// set fs root to the shared file/folder
d.user.Fs = afero.NewBasePathFs(d.user.Fs, basePath)
// the filesystem is now rebased onto basePath, so paths handed to the
// rule checker are relative to it. Resolve them back to the user's
// original scope so deny rules below the share root keep applying.
d.checkerPrefix = basePath
file, err = files.NewFileInfo(&files.FileOptions{
Fs: d.user.Fs,
Path: filePath,