Recent changes to truncate(2) swapped the ordering of some validations
authoranton <anton@openbsd.org>
Tue, 24 May 2022 05:14:30 +0000 (05:14 +0000)
committeranton <anton@openbsd.org>
Tue, 24 May 2022 05:14:30 +0000 (05:14 +0000)
commit760d825b763c6a895d5f192e66fe6c4e0c789a4a
tree7902fc6ed04eff0ec5f2517e125736ef265fd97c
parent30bc1efcff13e1ba0be3851c5b23cb658c5e5ff7
Recent changes to truncate(2) swapped the ordering of some validations
causing EACCESS as opposed of ESDIR to be returned while trying to
truncate a directory as a user lacking write permissions to the same
directory. As this behavior is reasonable, change the truncate directory
from /etc/ to /tmp which makes the test pass both as root and non-root.
regress/lib/libc/sys/t_truncate.c