The controller cannot know the operator's account's uid, names an access by its declared id (which holds a slash), and should not parse words. A tool runner's account may now come by name alone and is read here (refused when absent or root's, its uid said in the access's listing); the take act matches the declared id exactly; an access wait says its reason (keep or disk) and, for a filesystem that refuses ACLs, whether the take act can enable them.
64 lines
2.0 KiB
Go
64 lines
2.0 KiB
Go
//go:build !linux
|
|
|
|
package apply
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/novox/mesh-host/internal/declaration"
|
|
"github.com/novox/mesh-host/internal/store"
|
|
)
|
|
|
|
// The node-engine runs on Linux: a folder is kept only by descriptor and through the kernel's ACL attributes,
|
|
// which this system has not. Everything refuses, saying so, and changes nothing.
|
|
|
|
var errNoKeeping = errors.New("a shared folder is kept only by descriptor, which this system cannot; nothing was changed")
|
|
|
|
// FolderFacts is what the engine reads of a folder before keeping it.
|
|
type FolderFacts struct {
|
|
UID, GID uint32
|
|
Empty bool
|
|
}
|
|
|
|
func readFolder(string) (FolderFacts, error) { return FolderFacts{}, errNoKeeping }
|
|
func keepTop(string, map[uint32]bool) (bool, error) { return false, errNoKeeping }
|
|
func CreatePath(string) (int, error) { return 0, errNoKeeping }
|
|
func ReconcileKept(context.Context) []string { return nil }
|
|
func JudgeKept(string, []store.KeptUser, WalkLimits) (WalkCounts, error) {
|
|
return WalkCounts{}, errNoKeeping
|
|
}
|
|
|
|
// KeptLook is what one look found of a kept folder.
|
|
type KeptLook struct {
|
|
Short []string
|
|
Busy bool
|
|
Sweep store.KeptSweep
|
|
Repaired, Unrepaired int
|
|
Failed string
|
|
}
|
|
|
|
func LookKept(string, []store.KeptUser, WalkLimits) KeptLook {
|
|
return KeptLook{Failed: errNoKeeping.Error()}
|
|
}
|
|
|
|
func TakeFolder(context.Context, *declaration.Declaration, string, string, string, string, Runner) (<-chan struct{},
|
|
string, error) {
|
|
return nil, "", errNoKeeping
|
|
}
|
|
|
|
// Watcher watches nothing where a folder is not kept.
|
|
type Watcher struct{}
|
|
|
|
func NewWatcher() (*Watcher, error) { return nil, errNoKeeping }
|
|
func (*Watcher) Set(map[string][]store.KeptUser) {}
|
|
func (*Watcher) Run(context.Context) {}
|
|
|
|
// MountFsid reads no filesystem id where a folder is not kept.
|
|
var MountFsid = func(string) string { return "" }
|
|
|
|
// MountUUID reads no UUID where a folder is not kept.
|
|
var MountUUID = func(string) string { return "" }
|
|
|
|
func aclProbe(string, string) string { return "" }
|