Skip to content

Commit

Permalink
Stop resolving symlink in containWithRoot
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Stahl <[email protected]>
  • Loading branch information
darstahl committed May 9, 2018
1 parent 7a71e24 commit aa8e41b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,13 @@ func (c *context) contain(p string) (string, error) {
// instead of contain. This is needed for Walk, as if context root is a symlink,
// it must be evaluated prior to the Walk
func (c *context) containWithRoot(p string, root string) (string, error) {
fi, err := c.driver.Lstat(root)
if err == nil && fi.Mode()&os.ModeSymlink != 0 {
root, err = c.driver.Readlink(root)
if err != nil {
return "", err
}
}
//fi, err := c.driver.Lstat(root)
//if err == nil && fi.Mode()&os.ModeSymlink != 0 {
// root, err = c.driver.Readlink(root)
// if err != nil {
// return "", err
// }
//}
sanitized, err := c.pathDriver.Rel(root, p)
if err != nil {
return "", err
Expand Down

0 comments on commit aa8e41b

Please sign in to comment.