mirror of
https://github.com/restic/restic.git
synced 2026-05-17 23:55:24 +00:00
0962917974
Add new generic_attributes attribute in Node. Use the generic attributes to add support for creation time and file attributes like hidden, readonly, encrypted in windows. Handle permission errors for readonly files in windows. Handle backup and restore of encrypted attributes using windows system calls.
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
//go:build aix
|
|
// +build aix
|
|
|
|
package restic
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func (node Node) restoreSymlinkTimestamps(_ string, _ [2]syscall.Timespec) error {
|
|
return nil
|
|
}
|
|
|
|
// AIX has a funny timespec type in syscall, with 32-bit nanoseconds.
|
|
// golang.org/x/sys/unix handles this cleanly, but we're stuck with syscall
|
|
// because os.Stat returns a syscall type in its os.FileInfo.Sys().
|
|
func toTimespec(t syscall.StTimespec_t) syscall.Timespec {
|
|
return syscall.Timespec{Sec: t.Sec, Nsec: int64(t.Nsec)}
|
|
}
|
|
|
|
func (s statT) atim() syscall.Timespec { return toTimespec(s.Atim) }
|
|
func (s statT) mtim() syscall.Timespec { return toTimespec(s.Mtim) }
|
|
func (s statT) ctim() syscall.Timespec { return toTimespec(s.Ctim) }
|
|
|
|
// Getxattr is a no-op on AIX.
|
|
func Getxattr(path, name string) ([]byte, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// Listxattr is a no-op on AIX.
|
|
func Listxattr(path string) ([]string, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// Setxattr is a no-op on AIX.
|
|
func Setxattr(path, name string, data []byte) error {
|
|
return nil
|
|
}
|
|
|
|
// restoreGenericAttributes is no-op on AIX.
|
|
func (node *Node) restoreGenericAttributes(_ string) error {
|
|
return node.handleAllUnknownGenericAttributesFound()
|
|
}
|
|
|
|
// fillGenericAttributes is a no-op on AIX.
|
|
func (node *Node) fillGenericAttributes(_ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
|
|
return true, nil
|
|
}
|