Fix regression in bsdinstall post r356740 - partedit errno(2) 21 EISDIR

This resulted in the partitioning step failing if either of the
"Auto (UFS)" or "Manual" options were selected.

Reason: partedit was attempting to open a directory (TMPDIR) read/write,
which resulted in errno(2) 21 - EISDIR - Is a directory.

Reported by:	Clay Daniels <clay.daniels.jr@gmail.com>
Reviewed by:	Ryan Moeller <ryan@freqlabs.com>
Approved by:	emaste, bcran
Differential Revision:	https://reviews.freebsd.org/D23232
This commit is contained in:
Ben Woods 2020-01-17 22:26:41 +00:00
parent c1475a191e
commit 2d482628aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356855

View File

@ -93,7 +93,7 @@ main(int argc, const char **argv)
tmpdir = getenv("TMPDIR");
if (tmpdir == NULL)
tmpdir = "/tmp";
tmpdfd = open(tmpdir, O_RDWR | O_DIRECTORY);
tmpdfd = open(tmpdir, O_DIRECTORY);
if (tmpdfd < 0)
err(EX_OSERR, "%s", tmpdir);
unlinkat(tmpdfd, "bsdinstall-esps", 0);