diff --git a/core/commands/get.go b/core/commands/get.go index b3f8f740de31..caa39781aa53 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -266,7 +266,6 @@ func (gw *getWriter) writeExtracted(r io.Reader, fpath string) error { return sanitizedPath, err } extractor.LinkFunc = func(l tar.Link) error { - //remove existing if _, err := os.Lstat(l.Name); err == nil { if err = os.Remove(l.Name); err != nil { return err @@ -274,17 +273,12 @@ func (gw *getWriter) writeExtracted(r io.Reader, fpath string) error { } err := os.Symlink(l.Target, l.Name) - if err == nil { - return nil - } - if err != nil && haveLinkCreatePriviledge { // fail only on non-privilege errors - return err + if err != nil { + if haveLinkCreatePriviledge { // non privilege errors + return err + } + return errors.New("Symlink %q->%q cannot be created, user does not have symlink creation privileges (see:https://git.io/vpHKV)\n", l.Name, l.Target) } - - // otherwise skip link creation with a warning - modified = true - fmt.Fprintf(gw.Out, "Symlink %q->%q was skipped, user does not have symlink creation privileges (see:https://git.io/vpHKV)\n", l.Name, l.Target) - return nil } } diff --git a/docs/windows.md b/docs/windows.md index 085fa1e70a58..c7b77905e017 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -138,7 +138,7 @@ If `ipfs.exe` executes and everything matches, then building was successful. ## Troubleshooting - **Symlinks** -On Windows, a process must hold a special privilege(`SeCreateSymbolicLinkPrivilege`) in order to create [symlinks](). The way symlinks are implemented on Windows and the default security policies around them have caused some compatibility difficulties. As a result, the current behavior of `go-ipfs` on Windows, is to *not* create links if we do not have the ability to, instead, warning the user which links are being skipped, while still fetching the rest of the contents. +On Windows, a process must hold a special privilege(`SeCreateSymbolicLinkPrivilege`) in order to create [symlinks](). The way symlinks are implemented on Windows and the default security policies around them have caused some compatibility difficulties. There are various ways to enable symlink creation, depending on your version of Windows. Currently we support users who hold the [`SeCreateSymbolicLinkPrivilege`](), which covers Windows Vista+, as well users who have enabled "Developer Mode" in Windows 10(14972+). W10+, see this article: Vista+, see this article: