Clean paths from AllowedMounts to ensure consistency
This commit is contained in:
parent
20ece60a72
commit
2197d82957
|
@ -49,7 +49,9 @@ func (s *Server) customMounts() []environment.Mount {
|
|||
|
||||
mounted := false
|
||||
for _, allowed := range config.Get().AllowedMounts {
|
||||
if !strings.HasPrefix(source, allowed) {
|
||||
// Check if the source path is included in the allowed mounts list.
|
||||
// filepath.Clean will strip all trailing slashes (unless the path is a root directory).
|
||||
if !strings.HasPrefix(source, filepath.Clean(allowed)) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user