Add support for Windows EA in node

Refactor Extended Attribute related functions in node files as windows apis get and set EA in bulk
This commit is contained in:
aneesh-n
2024-05-17 14:18:20 -06:00
parent d6708505b9
commit 5cff6e084e
8 changed files with 246 additions and 96 deletions
+13 -2
View File
@@ -8,6 +8,7 @@ import (
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
"time"
@@ -205,8 +206,18 @@ func TestNodeRestoreAt(t *testing.T) {
var nodePath string
if test.ExtendedAttributes != nil {
if runtime.GOOS == "windows" {
// restic does not support xattrs on windows
return
// In windows extended attributes are case insensitive and windows returns
// the extended attributes in UPPER case.
// Update the tests to use UPPER case xattr names for windows.
extAttrArr := test.ExtendedAttributes
// Iterate through the array using pointers
for i := 0; i < len(extAttrArr); i++ {
// Get the pointer to the current element
namePtr := &extAttrArr[i].Name
// Modify the value through the pointer
*namePtr = strings.ToUpper(*namePtr)
}
}
// tempdir might be backed by a filesystem that does not support