From 565b80d348e288d29969a5c1d00827a8484d9e8b Mon Sep 17 00:00:00 2001 From: V Date: Tue, 8 Feb 2022 04:21:08 +0000 Subject: ripple/minitrace: log newfstatat paths Change-Id: Ieec434cdbddb45ab099bb9cf91dea1a135fd06ad --- ripple/minitrace/src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'ripple') 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 => { -- cgit 1.4.1