2022-03-28 22:23:47 +02:00
|
|
|
//go:build !windows
|
2015-08-14 15:57:47 +02:00
|
|
|
|
2024-08-26 23:03:25 +02:00
|
|
|
package fs
|
2015-08-14 15:57:47 +02:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
2024-11-03 13:27:58 +01:00
|
|
|
|
2025-09-23 20:01:09 +02:00
|
|
|
"github.com/restic/restic/internal/data"
|
2015-08-14 15:57:47 +02:00
|
|
|
)
|
|
|
|
|
|
2025-07-16 19:08:08 +02:00
|
|
|
func lchown(name string, node *data.Node, lookupByName bool) error {
|
|
|
|
|
var uid, gid uint32
|
|
|
|
|
if lookupByName {
|
|
|
|
|
uid = lookupUid(node.User)
|
|
|
|
|
gid = lookupGid(node.Group)
|
|
|
|
|
} else {
|
|
|
|
|
uid = node.UID
|
|
|
|
|
gid = node.GID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return os.Lchown(name, int(uid), int(gid))
|
2021-05-27 21:29:51 +02:00
|
|
|
}
|
2024-11-03 13:27:58 +01:00
|
|
|
|
|
|
|
|
// nodeRestoreGenericAttributes is no-op.
|
2025-09-23 20:01:09 +02:00
|
|
|
func nodeRestoreGenericAttributes(node *data.Node, _ string, warn func(msg string)) error {
|
|
|
|
|
return data.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
|
2024-11-03 13:27:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// nodeFillGenericAttributes is a no-op.
|
2025-09-23 20:01:09 +02:00
|
|
|
func nodeFillGenericAttributes(_ *data.Node, _ string, _ *ExtendedFileInfo) error {
|
2024-11-03 13:27:58 +01:00
|
|
|
return nil
|
|
|
|
|
}
|