This commit is contained in:
@@ -97,7 +97,7 @@ func (f *fakeConnection) addFileLocked(name string, flags uint32, ftype protocol
|
||||
file.Name = name
|
||||
file.Type = ftype
|
||||
file.Version = version
|
||||
file.SymlinkTarget = string(data)
|
||||
file.SymlinkTarget = data
|
||||
file.NoPermissions = true
|
||||
}
|
||||
f.files = append(f.files, file)
|
||||
|
||||
@@ -743,7 +743,7 @@ func (f *sendReceiveFolder) handleSymlink(file protocol.FileInfo, snap *db.Snaps
|
||||
l.Debugf("need symlink\n\t%v\n\t%v", file, curFile)
|
||||
}
|
||||
|
||||
if file.SymlinkTarget == "" {
|
||||
if len(file.SymlinkTarget) == 0 {
|
||||
// Index entry from a Syncthing predating the support for including
|
||||
// the link target in the index entry. We log this as an error.
|
||||
f.newPullError(file.Name, errIncompatibleSymlink)
|
||||
@@ -758,7 +758,7 @@ func (f *sendReceiveFolder) handleSymlink(file protocol.FileInfo, snap *db.Snaps
|
||||
// We declare a function that acts on only the path name, so
|
||||
// we can pass it to InWritableDir.
|
||||
createLink := func(path string) error {
|
||||
if err := f.mtimefs.CreateSymlink(file.SymlinkTarget, path); err != nil {
|
||||
if err := f.mtimefs.CreateSymlink(string(file.SymlinkTarget), path); err != nil {
|
||||
return err
|
||||
}
|
||||
return f.setPlatformData(&file, path)
|
||||
|
||||
@@ -891,7 +891,7 @@ func TestCopyOwner(t *testing.T) {
|
||||
Name: "foo/bar/sym",
|
||||
Type: protocol.FileInfoTypeSymlink,
|
||||
Permissions: 0o644,
|
||||
SymlinkTarget: "over the rainbow",
|
||||
SymlinkTarget: []byte("over the rainbow"),
|
||||
}
|
||||
|
||||
f.handleSymlink(symlink, snap, dbUpdateChan, scanChan)
|
||||
@@ -958,7 +958,7 @@ func TestSRConflictReplaceFileByLink(t *testing.T) {
|
||||
|
||||
// Simulate remote creating a symlink with the same name
|
||||
file.Type = protocol.FileInfoTypeSymlink
|
||||
file.SymlinkTarget = "bar"
|
||||
file.SymlinkTarget = []byte("bar")
|
||||
rem := device1.Short()
|
||||
file.Version = protocol.Vector{}.Update(rem)
|
||||
file.ModifiedBy = rem
|
||||
|
||||
Reference in New Issue
Block a user