From 8d419713deace4f9a132200d9292e65668c05bf3 Mon Sep 17 00:00:00 2001 From: klauspost Date: Thu, 13 Aug 2015 14:13:40 +0200 Subject: [PATCH] Disable symlinks on Windows. Windows cannot create symlinks without the user being administrator. --- node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.go b/node.go index 7a2b315a4..974f83834 100644 --- a/node.go +++ b/node.go @@ -15,6 +15,7 @@ import ( "github.com/restic/restic/debug" "github.com/restic/restic/pack" "github.com/restic/restic/repository" + "runtime" ) // Node is a file, directory or other item in a backup. @@ -236,6 +237,10 @@ func (node Node) createFileAt(path string, repo *repository.Repository) error { } func (node Node) createSymlinkAt(path string) error { + // Windows does not allow non-admins to create soft links. + if runtime.GOOS == "windows" { + return nil + } err := os.Symlink(node.LinkTarget, path) if err != nil { return errors.Annotate(err, "Symlink")