From 1ebe85202b1af5f8e9e76fd6db1e883c8a5155fe Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 27 Oct 2013 21:06:17 +0000 Subject: [PATCH] edquota: Don't pass fd for temporary file to editor. The editor opens the temporary file by name. --- usr.sbin/edquota/edquota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index a92a3c8f992..0cd117f1996 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -284,7 +284,7 @@ main(int argc, char *argv[]) freeprivs(protoprivs); exit(0); } - tmpfd = mkstemp(tmpfil); + tmpfd = mkostemp(tmpfil, O_CLOEXEC); fchown(tmpfd, getuid(), getgid()); if (tflag) { if ((protoprivs = getprivs(0, quotatype, fspath)) != NULL) {