1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 07:43:03 +00:00

Fix review comments

This commit is contained in:
aneesh-n 2024-08-10 10:38:04 -06:00
parent 71632a8197
commit 18e9d71d7a
No known key found for this signature in database
GPG key ID: 6F5A52831C046F44
3 changed files with 8 additions and 3 deletions

View file

@ -1,10 +1,12 @@
Bugfix: Skip EA processing in Windows for volumes that do not support EA
Restic was failing to backup files on some windows paths like network
drives because of errors while fetching ExtendedAttributes.
drives because of errors while fetching extended attributes.
Either they return error codes like windows.E_NOT_SET or
windows.ERROR_INVALID_FUNCTION or it results in slower backups.
Restic now completely skips the attempt to fetch Extended Attributes
Restic now completely skips the attempt to fetch extended attributes
for such volumes where it is not supported.
https://github.com/restic/restic/pull/4980
https://github.com/restic/restic/issues/4955
https://github.com/restic/restic/issues/4950

View file

@ -11,6 +11,7 @@ import (
"unsafe"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"golang.org/x/sys/windows"
)
@ -60,6 +61,8 @@ func GetSecurityDescriptor(filePath string) (securityDescriptor *[]byte, err err
if err != nil {
return nil, fmt.Errorf("get low-level named security info failed with: %w", err)
}
} else if errors.Is(err, windows.ERROR_NOT_SUPPORTED) {
return nil, nil
} else {
return nil, fmt.Errorf("get named security info failed with: %w", err)
}

View file

@ -392,7 +392,7 @@ func (node *Node) fillGenericAttributes(path string, fi os.FileInfo, stat *statT
return false, err
}
if sd, err = fs.GetSecurityDescriptor(path); err != nil {
return true, err
return allowExtended, err
}
}
// Add Windows attributes