Blame SOURCES/0001-Move-closing-standard-FDs-after-listen.patch

90e381
From 40fea4552377504ce69935149e64e39a595f4600 Mon Sep 17 00:00:00 2001
90e381
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
90e381
Date: Sat, 3 Aug 2019 17:50:14 +0200
90e381
Subject: [PATCH 1/2] Move closing standard FDs after listen()
90e381
90e381
The vsf_sysutil_close() calls need to be moved a bit further so that
90e381
die() works properly in case listen() fails.
90e381
90e381
I see no reason the calls should be placed before listen()
90e381
specifically, as they are now. My guess is that the author who added
90e381
the calls thought that listen() is a blocking call, which is not the
90e381
case. The only thing we need to satisfy is that close() is called
90e381
before accept, because that is a blocking call. That's all that is
90e381
needed to fix the bug that was fixed by adding the close() calls.
90e381
90e381
Resolves: rhbz#1666380
90e381
---
90e381
 standalone.c | 6 +++---
90e381
 1 file changed, 3 insertions(+), 3 deletions(-)
90e381
90e381
diff --git a/standalone.c b/standalone.c
90e381
index 3f35e9e..b358ca1 100644
90e381
--- a/standalone.c
90e381
+++ b/standalone.c
90e381
@@ -152,15 +152,15 @@ vsf_standalone_main(void)
90e381
       vsf_sysutil_kill(vsf_sysutil_getppid(), kVSFSysUtilSigUSR1);
90e381
     }
90e381
   }
90e381
-  vsf_sysutil_close(0);
90e381
-  vsf_sysutil_close(1);
90e381
-  vsf_sysutil_close(2);
90e381
   retval = vsf_sysutil_listen(listen_sock, VSFTP_LISTEN_BACKLOG);
90e381
   if (vsf_sysutil_retval_is_error(retval))
90e381
   {
90e381
     die("could not listen");
90e381
   }
90e381
   vsf_sysutil_sockaddr_alloc(&p_accept_addr);
90e381
+  vsf_sysutil_close(0);
90e381
+  vsf_sysutil_close(1);
90e381
+  vsf_sysutil_close(2);
90e381
   while (1)
90e381
   {
90e381
     struct vsf_client_launch child_info;
90e381
-- 
90e381
2.20.1
90e381