summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2011-09-27 18:53:25 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2011-09-27 18:53:25 +0000
commiteb79f3a06499080f0efa541a7067bc2cfd944ec1 (patch)
treee8d7d5f808d467fb2bdc28697a8c453154b907a8
parent0debadf3b51f4826dd83f2ac2015e8cf424ccfb5 (diff)
check closefrom() return value
use STDERR_FILENO instead of hard coded value ok gilles@
-rw-r--r--usr.sbin/smtpd/mfa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c
index 96af18ef5ed..22e5a19827c 100644
--- a/usr.sbin/smtpd/mfa.c
+++ b/usr.sbin/smtpd/mfa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfa.c,v 1.61 2011/08/31 18:56:30 gilles Exp $ */
+/* $OpenBSD: mfa.c,v 1.62 2011/09/27 18:53:24 chl Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -354,7 +354,8 @@ mfa_fork_filter(struct filter *filter)
/* filter */
dup2(sockpair[0], 0);
- closefrom(3);
+ if (closefrom(STDERR_FILENO + 1) < 0)
+ exit(1);
execl(filter->path, filter->name, NULL);
exit(1);