修复unlink、unlinkat系统调用的路径错误 (#892)

This commit is contained in:
MemoryShore 2024-08-15 00:31:38 +08:00 committed by GitHub
parent fe7d4d588c
commit f4acaec4ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -239,7 +239,7 @@ pub fn do_unlink_at(dirfd: i32, path: &str) -> Result<u64, SystemError> {
return Err(SystemError::EPERM); return Err(SystemError::EPERM);
} }
let (filename, parent_path) = rsplit_path(path); let (filename, parent_path) = rsplit_path(&remain_path);
// 查找父目录 // 查找父目录
let parent_inode: Arc<dyn IndexNode> = inode_begin let parent_inode: Arc<dyn IndexNode> = inode_begin
.lookup_follow_symlink(parent_path.unwrap_or("/"), VFS_MAX_FOLLOW_SYMLINK_TIMES)?; .lookup_follow_symlink(parent_path.unwrap_or("/"), VFS_MAX_FOLLOW_SYMLINK_TIMES)?;