Skip to content

Commit ce4086e

Browse files
committed
Create $XDG_RUNTIME_DIR in /run instead
Using tempfile::Builder::tempdir() defaults to creating this directory in /tmp, which is shared with the host and often somewhat persistent. This causes one extra directory to be created in the host /tmp every time muvm runs. Create this directory in /run instead, which is non-shared, and a more idiomatic place for $XDG_RUNTIME_DIR. Signed-off-by: Vivian Wang <[email protected]>
1 parent 5b35e56 commit ce4086e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/muvm/src/guest/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn setup_user(uid: Uid, gid: Gid) -> Result<PathBuf> {
1717
let path = tempfile::Builder::new()
1818
.prefix(&format!("muvm-run-{uid}-"))
1919
.permissions(Permissions::from_mode(0o700))
20-
.tempdir()
20+
.tempdir_in("/run")
2121
.context("Failed to create temp dir for `XDG_RUNTIME_DIR`")?
2222
.into_path();
2323
// SAFETY: Safe if and only if `muvm-guest` program is not multithreaded.

0 commit comments

Comments
 (0)