//! UTF-8 path component and transactional CWD guest probe. use super::*; use os_vfs_paths::{Error as PathError, PathState}; pub fn run(allocator: &mut memory::FrameAllocator) -> Result<(), &'static str> { let frames_before = allocator.remaining_pages(); let mut state = PathState::new(); let absolute = state.chdir("/veri/çalışma".as_bytes()) .map_err(|_| "k1545-absolute")?; if absolute.depth() != 2 || absolute.component(1) != Some("çalışma") || state.generation != 1 { return Err("k1545-absolute-state"); } let relative = state.chdir("../örnek/./belge".as_bytes()) .map_err(|_| "k1545-relative")?; if relative.depth() != 3 || relative.component(0) != Some("veri") || relative.component(1) != Some("örnek") || relative.component(2) != Some("belge") || state.generation != 2 { return Err("k1545-relative-state"); } let healthy = state; if state.chdir(&[b'/', 0xff]) != Err(PathError::InvalidUtf8) || state != healthy { return Err("k1545-invalid-UTF8-changed-CWD"); } let mut deep = [0u8; 34]; for index in 0..17 { deep[index * 2] = b'/'; deep[index * 2 + 1] = b'x'; } if state.chdir(&deep) != Err(PathError::TooDeep) || state != healthy || allocator.remaining_pages() != frames_before { return Err("k1545-deep-path-changed-CWD"); } write_line("TURKOS/OS/K1545-PATHS: ABS=2 REL=3 UTF8=REJECTED DEEP=REJECTED CWD=UNCHANGED GENERATION=2 FRAMES=UNCHANGED"); Ok(()) }