From 2d482628aac465ee5c8ab40a9111f02661be28cf Mon Sep 17 00:00:00 2001 From: Ben Woods Date: Fri, 17 Jan 2020 22:26:41 +0000 Subject: [PATCH] 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 Reviewed by: Ryan Moeller Approved by: emaste, bcran Differential Revision: https://reviews.freebsd.org/D23232 --- usr.sbin/bsdinstall/partedit/partedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c index 0fa03c99b36..c5fa28e7358 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -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);