2018-02-05 16:05:59 -05:00
|
|
|
package containerfs // import "github.com/docker/docker/pkg/containerfs"
|
2017-08-03 20:22:00 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
|
2020-10-29 19:54:10 -04:00
|
|
|
"github.com/moby/sys/symlink"
|
2017-08-03 20:22:00 -04:00
|
|
|
)
|
|
|
|
|
2022-09-22 20:17:25 -04:00
|
|
|
// ResolveScopedPath evaluates the given path scoped to the root.
|
|
|
|
// For example, if root=/a, and path=/b/c, then this function would return /a/b/c.
|
|
|
|
func ResolveScopedPath(root, path string) (string, error) {
|
|
|
|
return symlink.FollowSymlinkInScope(filepath.Join(root, path), root)
|
2017-08-03 20:22:00 -04:00
|
|
|
}
|