mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
rustjail: make the mount error info much more clear
Make the invalid mount destination's error info much more clear. Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
This commit is contained in:
parent
ce9a4eeffd
commit
33513fb49b
@ -176,7 +176,10 @@ pub fn init_rootfs(
|
||||
for m in &spec.mounts {
|
||||
let (mut flags, data) = parse_mount(&m);
|
||||
if !m.destination.starts_with("/") || m.destination.contains("..") {
|
||||
return Err(anyhow!(nix::Error::Sys(Errno::EINVAL)));
|
||||
return Err(anyhow!(
|
||||
"the mount destination {} is invalid",
|
||||
m.destination
|
||||
));
|
||||
}
|
||||
if m.r#type == "cgroup" {
|
||||
mount_cgroups(cfd_log, &m, rootfs, flags, &data, cpath, mounts)?;
|
||||
|
Loading…
Reference in New Issue
Block a user