2021-08-23 09:14:53 -04:00
|
|
|
//go:build linux || freebsd || darwin
|
2017-11-01 19:37:53 -04:00
|
|
|
// +build linux freebsd darwin
|
2015-09-09 22:23:06 -04:00
|
|
|
|
2018-04-17 16:50:28 -04:00
|
|
|
package mounts // import "github.com/docker/docker/volume/mounts"
|
2015-09-09 22:23:06 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2017-08-01 13:32:44 -04:00
|
|
|
func (p *linuxParser) HasResource(m *MountPoint, absolutePath string) bool {
|
2015-09-09 22:23:06 -04:00
|
|
|
relPath, err := filepath.Rel(m.Destination, absolutePath)
|
|
|
|
return err == nil && relPath != ".." && !strings.HasPrefix(relPath, fmt.Sprintf("..%c", filepath.Separator))
|
|
|
|
}
|