MCPcopy Create free account
hub / github.com/bootc-dev/bootc / newroot

Function newroot

crates/sysusers/src/lib.rs:615–630  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

613 }
614
615 fn newroot() -> Result<cap_std_ext::cap_tempfile::TempDir> {
616 let root = cap_std_ext::cap_tempfile::tempdir(cap_std::ambient_authority())?;
617 root.create_dir("etc")?;
618 root.write("etc/passwd", b"")?;
619 root.write("etc/group", b"")?;
620 root.create_dir_all(SYSUSERSD)?;
621 root.atomic_replace_with(
622 Utf8Path::new(SYSUSERSD).join("setup.conf"),
623 |w| -> std::io::Result<()> {
624 w.write_all(SYSUSERS_REF.as_bytes())?;
625 w.write_all(SYSGROUPS_REF.as_bytes())?;
626 Ok(())
627 },
628 )?;
629 Ok(root)
630 }
631
632 #[test]
633 fn test_missing() -> Result<()> {

Callers 1

test_missingFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_missingFunction · 0.56