From 666bd94f932ec6f1b031f3220bbc9f55ca83c409 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 20 Jun 2025 09:37:11 -0400 Subject: opt: "Not me" doesn't imply "nobody" We were making `-user ` imply `! -nouser`, which is valid, but we were also makeing `! -user ` imply `-nouser`, which isn't. Fix it by only constraining the `-nouser`/`-nogroup` predicates in the true case. While I'm here, fix a similar latent bug that would have triggered if we ever merged `-readable -and -writable` into one `R_OK | W_OK` test. Fixes: https://github.com/tavianator/bfs/issues/155 Fixes: 305ee902 ("opt: Track data flow information about predicates") --- tests/posix/user_o_user.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/posix/user_o_user.sh (limited to 'tests/posix/user_o_user.sh') diff --git a/tests/posix/user_o_user.sh b/tests/posix/user_o_user.sh new file mode 100644 index 0000000..7c143ae --- /dev/null +++ b/tests/posix/user_o_user.sh @@ -0,0 +1,3 @@ +# Regression test for +# https://github.com/tavianator/bfs/issues/155 +bfs_diff basic -user 0 -o -user "$(id -u)" -- cgit v1.2.3