github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/pkg/containerfs/containerfs.go (about)

     1  package containerfs // import "github.com/Prakhar-Agarwal-byte/moby/pkg/containerfs"
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"github.com/moby/sys/symlink"
     7  )
     8  
     9  // ResolveScopedPath evaluates the given path scoped to the root.
    10  // For example, if root=/a, and path=/b/c, then this function would return /a/b/c.
    11  func ResolveScopedPath(root, path string) (string, error) {
    12  	return symlink.FollowSymlinkInScope(filepath.Join(root, path), root)
    13  }