Check EA support only for volumes, files and dirs

This commit is contained in:
aneesh-n 2024-08-04 11:05:40 -06:00
parent 89712f6640
commit c13725b5d0
No known key found for this signature in database
GPG key ID: 6F5A52831C046F44

View file

@ -365,23 +365,26 @@ func (node *Node) fillGenericAttributes(path string, fi os.FileInfo, stat *statT
return false, nil
}
volumeName := filepath.VolumeName(path)
allowExtended, err = checkAndStoreEASupport(volumeName)
if err != nil {
return false, err
}
if strings.HasSuffix(filepath.Clean(path), `\`) {
// filepath.Clean(path) ends with '\' for Windows root volume paths only
// Do not process file attributes, created time and sd for windows root volume paths
// Security descriptors are not supported for root volume paths.
// Though file attributes and created time are supported for root volume paths,
// we ignore them and we do not want to replace them during every restore.
allowExtended, err = checkAndStoreEASupport(filepath.VolumeName(path))
if err != nil {
return false, err
}
return allowExtended, nil
}
var sd *[]byte
if node.Type == "file" || node.Type == "dir" {
// Check EA support and get security descriptor for file/dir only
allowExtended, err = checkAndStoreEASupport(filepath.VolumeName(path))
if err != nil {
return false, err
}
if sd, err = fs.GetSecurityDescriptor(path); err != nil {
return true, err
}