fix(dbfs): enforce root protection for single file share

This commit is contained in:
Aaron Liu
2025-04-21 19:43:09 +08:00
parent d60e400f83
commit 7b5e0e8581
11 changed files with 32 additions and 17 deletions

View File

@@ -621,7 +621,7 @@ func (s *GetFileInfoService) Get(c *gin.Context) (*FileResponse, error) {
return nil, serializer.NewError(serializer.CodeParamErr, "unknown uri", err)
}
opts := []fs.Option{dbfs.WithFilePublicMetadata()}
opts := []fs.Option{dbfs.WithFilePublicMetadata(), dbfs.WithNotRoot()}
if s.ExtendedInfo {
opts = append(opts, dbfs.WithExtendedInfo(), dbfs.WithEntityUser(), dbfs.WithFileShareIfOwned())
}