mirror of
https://https.git.savannah.gnu.org/git/findutils.git
synced 2026-01-26 15:39:06 +00:00
On GNU/Hurd, the value 0 is a valid inode number, and is e.g. used for /dev/console and /dev/tty. The find(1) program aborted on this platform when the user specified the -inum test and when the search visited such a file. $ find /dev/null /dev/tty -inum 40799 -printf '%i:%p\n' 40799:/dev/null find: util.c:330: get_info: Assertion `p->st_ino' failed. Aborted Likewise, 'find -printf %i' aborted when hitting such a file. * find/defs.h (get_info): Remove declaration. * find/pred.c (pred_inum): Remove the redundant assert for ST_INO as parse_inum sets need_inum=true which ensures that the inode number is known. * find/util.c (get_info): Declare static, and simplify: remove the assertions for the inode number and file type. While at it, add condition !state.have_stat in the need_stat case for consistency. * tests/find/inode-zero.sh: Add test. * tests/local.mk (all_tests): Reference it. Problem introduced by the inum optimisation in commit 2bf001636e6. Reported by Andrea Monaco <andrea.monaco@autistici.org> in https://lists.gnu.org/r/bug-findutils/2021-12/msg00008.html