lib/model: Set platform data, incl. copying ownership, for new folders w/ NoPermissions flag (#8883)

Platform data (ownership, xattrs, etc.) is now set correctly for newly-received folders, even if the received folder has the NoPermissions flag.
This commit is contained in:
Anthony Goeckner 2023-05-02 04:11:39 -05:00 committed by GitHub
parent a4fa764b7d
commit 7e31ec5417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -622,7 +622,7 @@ func (f *sendReceiveFolder) handleDir(file protocol.FileInfo, snap *db.Snapshot,
// not MkdirAll because the parent should already exist.
mkdir := func(path string) error {
err = f.mtimefs.Mkdir(path, mode)
if err != nil || f.IgnorePerms || file.NoPermissions {
if err != nil || f.IgnorePerms {
return err
}
@ -631,6 +631,10 @@ func (f *sendReceiveFolder) handleDir(file protocol.FileInfo, snap *db.Snapshot,
return err
}
if file.NoPermissions {
return nil
}
// Stat the directory so we can check its permissions.
info, err := f.mtimefs.Lstat(path)
if err != nil {