From edae0b07db841e3bf8449d591971f04c9957ecbc Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 12 Sep 2015 15:46:46 -0500 Subject: Fix a find segfault. Elliott Hughes found a bug https://android-review.googlesource.com/#/c/170020/ and Daniel K. Levy worked out the problem: the user/group/newer arguments to find weren't consuming their arguments when not checking the results of their comparison (because an earlier test had already caused their parenthetical group to fail). This confused the argument parsing logic and could lead to segfaults. I applied a different fix that reorganized the existing tests instead of adding a new test. (Looks like a big commit but it's mostly whitespace due to extra curly brackets changing indendentation levels.) --- tests/find.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/find.test') diff --git a/tests/find.test b/tests/find.test index cbbce5fd..65bbb501 100755 --- a/tests/find.test +++ b/tests/find.test @@ -39,4 +39,8 @@ testing "find -type f -a -print" \ testing "find -print -o -print" \ "find dir -type f -a \( -print -o -print \)" "dir/file\n" "" "" +# these were erroring or segfaulting: +# find -type f -user nobody -exec : \; +# find -type f -user nobody -exec : -exec : \; + rm -rf dir -- cgit v1.2.3