forked from TrueCloudLab/restic
Check EA support only for volumes, files and dirs
This commit is contained in:
parent
89712f6640
commit
c13725b5d0
1 changed files with 9 additions and 6 deletions
|
@ -365,23 +365,26 @@ func (node *Node) fillGenericAttributes(path string, fi os.FileInfo, stat *statT
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
volumeName := filepath.VolumeName(path)
|
|
||||||
allowExtended, err = checkAndStoreEASupport(volumeName)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasSuffix(filepath.Clean(path), `\`) {
|
if strings.HasSuffix(filepath.Clean(path), `\`) {
|
||||||
// filepath.Clean(path) ends with '\' for Windows root volume paths only
|
// 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
|
// Do not process file attributes, created time and sd for windows root volume paths
|
||||||
// Security descriptors are not supported for root volume paths.
|
// Security descriptors are not supported for root volume paths.
|
||||||
// Though file attributes and created time are 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.
|
// 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
|
return allowExtended, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var sd *[]byte
|
var sd *[]byte
|
||||||
if node.Type == "file" || node.Type == "dir" {
|
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 {
|
if sd, err = fs.GetSecurityDescriptor(path); err != nil {
|
||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue