Record a removal's outcome, publish it, and read one directory once
The record kept only the intent, so a failed unlink read as removed; each link now gets a synced intent and outcome line, and the outcome is the module's link.removal event so it is not only a file on one machine. The put-back hint no longer advises a symlink, an aliased directory is read once, a machine-wide removal from user scope is said, and the state directory names no owner a machine without an account cannot resolve.
This commit is contained in:
@@ -147,6 +147,11 @@ type Manager struct {
|
||||
// State is the module's state directory, where each removed link is recorded.
|
||||
State string
|
||||
Now func() time.Time
|
||||
// Emit publishes one of this module's events (unlink.go).
|
||||
Emit func(eventType string, body any) error
|
||||
// Resolve is a directory's path with every link in it followed, so one directory reached by two
|
||||
// names is searched once (on Arch /etc/xdg/systemd/user leads to /etc/systemd/user).
|
||||
Resolve func(path string) (string, error)
|
||||
}
|
||||
|
||||
var userBus = regexp.MustCompile(`(?i)Failed to connect to (user scope )?bus`)
|
||||
|
||||
Reference in New Issue
Block a user