Fluxion::Executor::Installer
Puts a verified file at its destination.
Two paths, chosen by whether the destination's parent is writable:
- Unprivileged — stage beside the destination, set the mode, then rename. The rename is atomic, so a reader either sees the old file or the new one, never a half-written binary.
- Privileged — stage under a root-owned anchor with
install, re-verify the digest there (a file staged in a world-writable temp directory could be swapped between verification and the move), thenmv -fT.
A destination whose parent is neither writable nor safely root-owned is refused rather than forced, because writing through a directory someone else can replace is not an install, it is a hope.
Constants
STAGING_ROOT = "/run/fluxion"
Where privileged staging happens. Under /run so it is on a tmpfs, and created root-owned with restrictive permissions before use.
SUDO_TIMEOUT = 1.minute
Constructors
new(runner : ShellRunner)
SourceInstance methods
install(source : String, destination : String, mode : String = "0755", digest : String | Nil = nil, symlink : String | Nil = nil) : Nil
Installs source at destination.
digest is required for the privileged path: without it there is nothing
to re-verify after staging, and staging is exactly where a swap would
happen.
Decides how the destination has to be written, refusing unsafe parents.