From 74ca749704c53f96155a6411aca1077096a53b61 Mon Sep 17 00:00:00 2001 From: edef Date: Fri, 8 Jul 2022 14:11:38 +0000 Subject: ripple/minitrace: convert openat dirfd correctly Our conversion always mangled it, *and* our comparison was inverted, so both bugs remained hidden. Change-Id: Ied63822001c8700fc71c89ec16d18036fbc33972 --- ripple/minitrace/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index ee09c99..bdf957d 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -286,7 +286,9 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { 257 => { let [dirfd, pathname, flags, _mode, ..] = entry.args; - if dirfd.try_into() == Ok(AT_FDCWD) { + let dirfd = u32::try_from(dirfd).map(|x| x as i32); + + if dirfd != Ok(AT_FDCWD) { return false; } -- cgit 1.4.1