mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +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:
		| @@ -176,7 +176,10 @@ pub fn init_rootfs( | |||||||
|     for m in &spec.mounts { |     for m in &spec.mounts { | ||||||
|         let (mut flags, data) = parse_mount(&m); |         let (mut flags, data) = parse_mount(&m); | ||||||
|         if !m.destination.starts_with("/") || m.destination.contains("..") { |         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" { |         if m.r#type == "cgroup" { | ||||||
|             mount_cgroups(cfd_log, &m, rootfs, flags, &data, cpath, mounts)?; |             mount_cgroups(cfd_log, &m, rootfs, flags, &data, cpath, mounts)?; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user