pub enum PrivilegedOp {
WriteSshdConfig {
content: String,
},
}Expand description
An operation that requires elevated privileges to perform.
Each variant fully describes the privileged write so the boundary stays auditable — there is no generic “run any command” escape hatch.
Variants§
WriteSshdConfig
Atomically install new contents for /etc/ssh/sshd_config.
The caller has already serialized the desired file content. This op:
- Stages the content in an O_EXCL, unpredictable-named temp file in
the same directory as the target (
/etc/ssh) — so the install is an atomicrename(2)within one filesystem, andsshd -tresolves relativeIncludedirectives (e.g. the defaultInclude /etc/ssh/sshd_config.d/*.conf) against the live directory. - Always validates the staged file with
sshd -tthrough the privileged path. If thesshdbinary is genuinely unavailable, the write fails closed — an unvalidatable config is never installed. - Backs up the existing config to
<path>.bakbefore install. A backup failure is fatal (the write aborts without touching the live config). - Installs the temp into place via a single
rename(2).
Trait Implementations§
Source§impl Clone for PrivilegedOp
impl Clone for PrivilegedOp
Source§fn clone(&self) -> PrivilegedOp
fn clone(&self) -> PrivilegedOp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrivilegedOp
impl RefUnwindSafe for PrivilegedOp
impl Send for PrivilegedOp
impl Sync for PrivilegedOp
impl Unpin for PrivilegedOp
impl UnsafeUnpin for PrivilegedOp
impl UnwindSafe for PrivilegedOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more