mirror of
https://github.com/restic/restic.git
synced 2026-05-20 09:05:23 +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.
40 lines
983 B
Go
40 lines
983 B
Go
package restic
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func (node Node) restoreSymlinkTimestamps(_ string, _ [2]syscall.Timespec) error {
|
|
return nil
|
|
}
|
|
|
|
func (s statT) atim() syscall.Timespec { return s.Atimespec }
|
|
func (s statT) mtim() syscall.Timespec { return s.Mtimespec }
|
|
func (s statT) ctim() syscall.Timespec { return s.Ctimespec }
|
|
|
|
// Getxattr is a no-op on netbsd.
|
|
func Getxattr(path, name string) ([]byte, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// Listxattr is a no-op on netbsd.
|
|
func Listxattr(path string) ([]string, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// Setxattr is a no-op on netbsd.
|
|
func Setxattr(path, name string, data []byte) error {
|
|
return nil
|
|
}
|
|
|
|
// restoreGenericAttributes is no-op on netbsd.
|
|
func (node *Node) restoreGenericAttributes(_ string) error {
|
|
return node.handleAllUnknownGenericAttributesFound()
|
|
}
|
|
|
|
// fillGenericAttributes is a no-op on netbsd.
|
|
func (node *Node) fillGenericAttributes(_ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
|
|
return true, nil
|
|
}
|