summary refs log tree commit diff
path: root/ripple/minitrace
diff options
context:
space:
mode:
Diffstat (limited to 'ripple/minitrace')
-rw-r--r--ripple/minitrace/src/main.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index bdf957d..cd69094 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -304,13 +304,16 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool {
 		262 => {
 			let [dirfd, pathname, _statbuf, _flags, ..] = entry.args;
 
-			if dirfd.try_into() == Ok(AT_FDCWD) {
-				return false;
-			}
-
+			let dirfd = u32::try_from(dirfd).map(|x| x as i32);
 			let pathname = process.read_mem_cstr(pathname).unwrap();
 
-			println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname);
+			if dirfd == Ok(AT_FDCWD) {
+				println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname);
+			} else if pathname.as_bytes() == b"" {
+				println!("newfstatat({dirfd}, {:?}, ..)", pathname);
+			} else {
+				return false;
+			}
 		}
 
 		// set_robust_list