]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix crunchgen usage of mkstemp()
authorarichardson <arichardson@FreeBSD.org>
Wed, 12 Aug 2020 15:49:06 +0000 (15:49 +0000)
committerarichardson <arichardson@FreeBSD.org>
Wed, 12 Aug 2020 15:49:06 +0000 (15:49 +0000)
commit1f1c6ec15bc7703469f828e30f2ff7f9b51fad31
treec383d8b64584eb47a20a83555e17e2e52d17cf64
parent5bb0b4a5490c14f2f8bc8ce04af703f669299cad
Fix crunchgen usage of mkstemp()

On Glibc systems mkstemp can only be used once with the same template
string since it will be modified in-place and no longer contain any 'X' chars.
It is fine to reuse the same file here but we need to be explicit and use
open() instead of mkstemp() on the second use.

While touching this file also avoid a hardcoded /bin/pwd since that may not
work when building on non-FreeBSD systems.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D25990
usr.sbin/crunch/crunchgen/crunchgen.c