The openat() then fstat() pattern only works if one is sure the file being
authorclaudio <claudio@openbsd.org>
Mon, 17 May 2021 11:49:01 +0000 (11:49 +0000)
committerclaudio <claudio@openbsd.org>
Mon, 17 May 2021 11:49:01 +0000 (11:49 +0000)
commite107519e0dca9b2a35b765030c89e0eaa520ff11
treebd2a76f31e95db311f1d8da9af1eff80487bf9e8
parent4d38a6784bd5f89744818c196af718035f41491d
The openat() then fstat() pattern only works if one is sure the file being
opened is a regular file. In other cases this may block in openat() (since
the O_NONBLOCK flag removed). Switch to fstatat() and then openat() to
protect from involuntary side-effects (like opening a device node) and
possible hangs.
OK benno@
usr.bin/rsync/uploader.c