2022-03-28 16:23:47 -04:00
|
|
|
//go:build !windows
|
2020-05-24 13:30:20 -04:00
|
|
|
// +build !windows
|
2015-08-14 09:57:47 -04:00
|
|
|
|
2024-08-26 17:03:25 -04:00
|
|
|
package fs
|
2015-08-14 09:57:47 -04:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
2024-11-03 07:27:58 -05:00
|
|
|
|
2025-09-23 14:01:09 -04:00
|
|
|
"github.com/restic/restic/internal/data"
|
2015-08-14 09:57:47 -04:00
|
|
|
)
|
|
|
|
|
|
2025-07-16 13:08:08 -04: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 15:29:51 -04:00
|
|
|
}
|
2024-11-03 07:27:58 -05:00
|
|
|
|
|
|
|
|
// nodeRestoreGenericAttributes is no-op.
|
2025-09-23 14:01:09 -04:00
|
|
|
func nodeRestoreGenericAttributes(node *data.Node, _ string, warn func(msg string)) error {
|
|
|
|
|
return data.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
|
2024-11-03 07:27:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// nodeFillGenericAttributes is a no-op.
|
2025-09-23 14:01:09 -04:00
|
|
|
func nodeFillGenericAttributes(_ *data.Node, _ string, _ *ExtendedFileInfo) error {
|
2024-11-03 07:27:58 -05:00
|
|
|
return nil
|
|
|
|
|
}
|