A module's containers ran as whatever their image chose and shared folders were made writable by putting accounts in the folder's group (ADR 0312), which ADR 0325 supersedes. The engine now makes each declared module identity as a system account with the controller's numbers, runs a container declaring `identity` as it, and keeps each placed shared folder usable through one POSIX ACL entry per user, set through the kernel's xattrs on descriptors it opened itself. A folder holding data is kept only after the operator's warrant (the take act); a missing folder is made where its data lives and waits where its disk is not; root's data is never kept. A watch and a bounded sweep put back what an app narrows. The group grant is removed, and what it put an account in is taken back. Reuses the descriptor walks, the create act, the missing-path wait and the warrant- backed act message from the paused issue 567 branch.
56 lines
1.8 KiB
Go
56 lines
1.8 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) {}
|