all: Make scanning ownership opt-in (#8497)
This commit is contained in:
@@ -646,6 +646,7 @@ func (f *folder) scanSubdirsChangedAndNew(subDirs []string, batch *scanBatch) (i
|
||||
LocalFlags: f.localFlags,
|
||||
ModTimeWindow: f.modTimeWindow,
|
||||
EventLogger: f.evLogger,
|
||||
ScanOwnership: f.ScanOwnership || f.SyncOwnership,
|
||||
}
|
||||
var fchan chan scanner.ScanResult
|
||||
if f.Type == config.FolderTypeReceiveEncrypted {
|
||||
|
||||
@@ -989,7 +989,7 @@ func (f *sendReceiveFolder) renameFile(cur, source, target protocol.FileInfo, sn
|
||||
err = errModified
|
||||
default:
|
||||
var fi protocol.FileInfo
|
||||
if fi, err = scanner.CreateFileInfo(stat, target.Name, f.mtimefs); err == nil {
|
||||
if fi, err = scanner.CreateFileInfo(stat, target.Name, f.mtimefs, f.SyncOwnership); err == nil {
|
||||
if !fi.IsEquivalentOptional(curTarget, protocol.FileInfoComparison{
|
||||
ModTimeWindow: f.modTimeWindow,
|
||||
IgnorePerms: f.IgnorePerms,
|
||||
@@ -1977,7 +1977,7 @@ func (f *sendReceiveFolder) deleteDirOnDiskHandleChildren(dir string, snap *db.S
|
||||
hasReceiveOnlyChanged = true
|
||||
return nil
|
||||
}
|
||||
diskFile, err := scanner.CreateFileInfo(info, path, f.mtimefs)
|
||||
diskFile, err := scanner.CreateFileInfo(info, path, f.mtimefs, f.SyncOwnership)
|
||||
if err != nil {
|
||||
// Lets just assume the file has changed.
|
||||
scanChan <- path
|
||||
@@ -2054,7 +2054,7 @@ func (f *sendReceiveFolder) scanIfItemChanged(name string, stat fs.FileInfo, ite
|
||||
// to the database. If there's a mismatch here, there might be local
|
||||
// changes that we don't know about yet and we should scan before
|
||||
// touching the item.
|
||||
statItem, err := scanner.CreateFileInfo(stat, item.Name, f.mtimefs)
|
||||
statItem, err := scanner.CreateFileInfo(stat, item.Name, f.mtimefs, f.SyncOwnership)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "comparing item on disk to db")
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func createEmptyFileInfo(t *testing.T, name string, fs fs.Filesystem) protocol.F
|
||||
writeFile(t, fs, name, nil)
|
||||
fi, err := fs.Stat(name)
|
||||
must(t, err)
|
||||
file, err := scanner.CreateFileInfo(fi, name, fs)
|
||||
file, err := scanner.CreateFileInfo(fi, name, fs, false)
|
||||
must(t, err)
|
||||
return file
|
||||
}
|
||||
@@ -777,7 +777,7 @@ func TestDeleteIgnorePerms(t *testing.T) {
|
||||
|
||||
stat, err := file.Stat()
|
||||
must(t, err)
|
||||
fi, err := scanner.CreateFileInfo(stat, name, ffs)
|
||||
fi, err := scanner.CreateFileInfo(stat, name, ffs, false)
|
||||
must(t, err)
|
||||
ffs.Chmod(name, 0600)
|
||||
scanChan := make(chan string, 1)
|
||||
|
||||
Reference in New Issue
Block a user