openat should return ENOENT if path is empty

This commit is contained in:
jiangjianfeng 2025-08-28 08:21:35 +00:00 committed by Tate, Hongliang Tian
parent 09886fc15b
commit 3cbc9b4bf7
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,10 @@ pub fn sys_openat(
dirfd, path, flags, mode
);
if path.is_empty() {
return_errno_with_message!(Errno::ENOENT, "openat fails with empty path");
}
let file_handle = {
let path = path.to_string_lossy();
let fs_path = FsPath::new(dirfd, path.as_ref())?;