bsdinstall: avoid conflicts with fd 3
Throughout the bsdinstall script fd 3 is used by f_dprintf (set through
$TERMINAL_STDOUT_PASSTHRU). In several places in the bsdinstalls scripts,
we use fd 3 to juggle stdout when calling out to other tools, which can
cause the installer to fail with a "Bad file descriptor" error when
f_dprintf attempts to use it.
This commit replaces all constructs like this:
exec 3>&1 SOME_VARIABLE=$(some command 2>&1 1>&3) exec 3>&-
With:
exec 5>&1 SOME_VARIABLE=$(some command 2>&1 1>&5) exec 5>&-
PR: 273148
Reviewed by: corvink
Fixes: 1f7746d81f53447ac15cc99395bb714d4dd0a4da ("bsdinstall: stop messing with file descriptors")
MFC after: 1 week