From c7dda21e969247d7cf54b033ef4672d46f5bc811 Mon Sep 17 00:00:00 2001 From: Jianfeng Jiang Date: Tue, 13 Jun 2023 17:16:21 +0800 Subject: [PATCH] Remove special path in open --- services/libs/jinux-std/src/syscall/open.rs | 22 --------------------- 1 file changed, 22 deletions(-) diff --git a/services/libs/jinux-std/src/syscall/open.rs b/services/libs/jinux-std/src/syscall/open.rs index 9cab7a563..bca6c4ab0 100644 --- a/services/libs/jinux-std/src/syscall/open.rs +++ b/services/libs/jinux-std/src/syscall/open.rs @@ -24,28 +24,6 @@ pub fn sys_openat( dirfd, pathname, flags, mode ); - // TODO: do real openat - - // Below are three special files we encountered when running busybox ash. - // We currently only return ENOENT, which means the file does not exist. - if dirfd == AT_FDCWD && pathname == CString::new("/etc/passwd")? { - return_errno_with_message!(Errno::ENOENT, "No such file"); - } - - if dirfd == AT_FDCWD && pathname == CString::new("/etc/profile")? { - return_errno_with_message!(Errno::ENOENT, "No such file"); - } - - if dirfd == AT_FDCWD && pathname == CString::new("./trace")? { - // Debug use: This file is used for output busybox log - let trace_file = Arc::new(BusyBoxTraceFile); - let current = current!(); - let mut file_table = current.file_table().lock(); - let fd = file_table.insert(trace_file); - return Ok(SyscallReturn::Return(fd as _)); - } - - // The common path let current = current!(); let file_handle = { let pathname = pathname.to_string_lossy();