2018-02-05 21:05:59 +00:00
|
|
|
package containerfs // import "github.com/docker/docker/pkg/containerfs"
|
2017-08-04 00:22:00 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
|
2020-10-29 23:54:10 +00:00
|
|
|
"github.com/moby/sys/symlink"
|
2017-08-04 00:22:00 +00:00
|
|
|
)
|
|
|
|
|
2022-09-23 00:17:25 +00: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-04 00:22:00 +00:00
|
|
|
}
|