Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.

Allow symlinks that use absolute path within the memfs/tar.#291

Open
sahilrihan wants to merge 1 commit intouber-archive:masterfrom
sahilrihan:abs_link
Open

Allow symlinks that use absolute path within the memfs/tar.#291
sahilrihan wants to merge 1 commit intouber-archive:masterfrom
sahilrihan:abs_link

Conversation

@sahilrihan
Copy link

Fixes case where /home/rihan/bar/etc/alternatives/pager is symlinked to /bin/more. Without this change TrimRoot fails when it tries to trim fs.tree.src from linkTarget.

Fixes case where /home/rihan/bar/etc/alternatives/pager is symlinked to /bin/more
@CLAassistant
Copy link

CLAassistant commented Nov 26, 2019

CLA assistant check
All committers have signed the CLA.

if err != nil {
return fmt.Errorf("trim link %s: %s", linkTarget, err)
}
if filepath.IsAbs(linkTarget) && strings.HasPrefix(linkTarget, fs.tree.src) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space after if

}
if filepath.IsAbs(linkTarget) && strings.HasPrefix(linkTarget, fs.tree.src) {
linkTarget, err = pathutils.TrimRoot(linkTarget, fs.tree.src)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing looks wrong

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants