diff options
Diffstat (limited to 'ripple/minitrace')
-rw-r--r-- | ripple/minitrace/src/main.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index a8781f5..e5bb1f0 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -198,6 +198,8 @@ fn main() -> Result<()> { Ok(()) } +const AT_FDCWD: i32 = -100; + fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { match entry.number { // read @@ -279,7 +281,6 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { // openat 257 => { let [dirfd, pathname, flags, _mode, ..] = entry.args; - const AT_FDCWD: i32 = -100; if dirfd.try_into() == Ok(AT_FDCWD) { return false; @@ -294,7 +295,17 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { } // newfstatat - 262 => {} + 262 => { + let [dirfd, pathname, _statbuf, _flags, ..] = entry.args; + + if dirfd.try_into() == Ok(AT_FDCWD) { + return false; + } + + let pathname = process.read_mem_cstr(pathname).unwrap(); + + println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname); + } // prlimit64 302 => { |