class

Fluxion::Executor::Installer

Inherits Reference < Object

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), then mv -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)
Source

Instance methods

privilege_for(destination : String) : Privilege

Decides how the destination has to be written, refusing unsafe parents.

Source
write(content : String, destination : String, mode : String = "0644", owner : String | Nil = nil, group : String | Nil = nil) : Nil

Writes text to a destination, honouring the same privilege split.

Source

Nested types