Files
mesh-host/internal/apply/walk_other.go
T
jschoubben 46c16e18fe Name a filesystem by its UUID, its kernel id or its source, and keep nothing that has no name (hq ADR 0325 fifth review)
NFS and FUSE report a zero f_fsid, so another export or another FUSE mount at the
same point was named alike and kept without a warrant; xfs's f_fsid follows the
device number. A filesystem is now named by its UUID (its device matched in
/dev/disk/by-uuid), else a nonzero f_fsid, else mountinfo's source; one that cannot
be named is never kept or taken. Entries left on a filesystem not back within 30 days
are forgotten, said once, and the naming read is shared per mount.
2026-10-12 19:14:42 +02:00

62 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 "" }