Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import (
"github.com/pkg/errors"
)

func IsSymlink(p string) bool {
fi, err := os.Lstat(p)
if err != nil {
// Some people can't be helped
return false
}

return fi.Mode()&os.ModeSymlink != 0
}

// DirCopy copies a whole directory recursively
func DirCopy(dest string, source string) error {

Expand Down
7 changes: 6 additions & 1 deletion overlay/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,12 @@ func stripOverlayAttrsUnder(dirPath string) error {
if err != nil {
return err
}
return stripOverlayAttrs(filepath.Join(dirPath, path))
p := filepath.Join(dirPath, path)
if lib.IsSymlink(p) {
// user.* xattrs "can not" exist on symlinks
return nil
}
return stripOverlayAttrs(p)
})
}

Expand Down