Skip to content

Commit 1e9cec2

Browse files
committed
Use cwd as krun's workdir
Signed-off-by: Nikodem Rabuliński <[email protected]>
1 parent af473fa commit 1e9cec2

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

crates/muvm/src/bin/muvm.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use muvm::utils::launch::{
2626
GuestConfiguration, Launch, HIDPIPE_SOCKET, MUVM_GUEST_SOCKET, PULSE_SOCKET,
2727
};
2828
use nix::sys::sysinfo::sysinfo;
29-
use nix::unistd::User;
3029
use rustix::io::Errno;
3130
use rustix::process::{
3231
geteuid, getgid, getrlimit, getuid, sched_setaffinity, setrlimit, CpuSet, Resource,
@@ -346,14 +345,9 @@ fn main() -> Result<ExitCode> {
346345
}
347346
}
348347

349-
let uid = getuid().as_raw();
350-
let user = User::from_uid(uid.into())
351-
.map_err(Into::into)
352-
.and_then(|user| user.ok_or_else(|| anyhow!("requested entry not found")))
353-
.with_context(|| format!("Failed to get user `{uid}` from user database"))?;
354-
348+
let workdir_path = env::current_dir()?;
355349
let workdir_path = CString::new(
356-
user.dir
350+
workdir_path
357351
.to_str()
358352
.expect("workdir_path should not contain invalid UTF-8"),
359353
)
@@ -390,7 +384,7 @@ fn main() -> Result<ExitCode> {
390384
tty: false,
391385
privileged: false,
392386
},
393-
uid,
387+
uid: getuid().as_raw(),
394388
gid: getgid().as_raw(),
395389
host_display: display,
396390
merged_rootfs: options.merged_rootfs,

0 commit comments

Comments
 (0)