Benign rust 5,494 installs Download

bootc-internal-mount 1.16.12

“Internal implementation component of bootc; do not use”

Rust test marker or harnessimports cap_std_ext::cap_std::fs::Dir
SHA-256f545f0436e9d56320af1c49390fc7c78b083d91d1fd509619d6cc3fe41f331c9

Evidence

imports cap_std_ext::cap_std::fs::Dir lines 1–29
1//! Helpers for interacting with mountpoints
2
3use std::{
4 fs,
5 mem::MaybeUninit,
6 os::fd::{AsFd, OwnedFd},
7 process::Command,
8};
9
10use anyhow::{Context, Result, anyhow};
11use bootc_utils::CommandRunExt;
12use camino::Utf8Path;
13use cap_std_ext::{cap_std::fs::Dir, cmdext::CapStdExtCommandExt};
14use fn_error_context::context;
15use rustix::{
16 mount::{MoveMountFlags, OpenTreeFlags},
17 net::{
18 AddressFamily, RecvFlags, SendAncillaryBuffer, SendAncillaryMessage, SendFlags,
19 SocketFlags, SocketType,
20 },
21 process::WaitOptions,
22 thread::Pid,
23};
24use serde::Deserialize;
25
26/// Temporary mount management with automatic cleanup.
27pub mod tempmount;
28
29/// Well known ide …
Constructs a Rust process command lines 64–76
64:29… esystem>,
65}
66
67/// Run `findmnt` with JSON output and parse the result.
68pub fn run_findmnt(args: &[&str], cwd: Option<&Dir>, path: Option<&str>) -> Result<Findmnt> {
69 let mut cmd = Command::new("findmnt");
70 if let Some(cwd) = cwd {
71 cmd.cwd_dir(cwd.try_clone()?);
⋯5 lines
Executes proc via Rust std::proc::cmd lines 186–194
186:39…
187pub fn mount(dev: &str, target: &Utf8Path) -> Result<()> {
188 Command::new("mount")
189 .args([dev, target.as_str()])
190 .run_inherited_with_cmd_context()
⋯4 lines
Calls native open or sys_open lines 253–256
253:68… e descriptor, and enter it.
254 let pidlink = fs::File::open(format!("/proc/{}/ns/mnt", pid.as_raw_nonzero()))?;
255 rustix::thread::move_into_link_name_space(
256 pidli …
imports camino::Utf8PathBuf lines 365–375
365:45… {path}");
366 bind_mount_from_pidns(PID1, path, path, true)
367}
368
369#[cfg(test)]
370mod tests {
371 use super::*;
372 use camino::Utf8PathBuf;
373
374 fn mk_fs(source: &str, target: &str, children: Vec<Filesystem>) -> Filesystem {
375 F …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.