Blame SOURCES/0006-Close-stdin-out-err-before-listening-for-incoming-co.patch

d7fdbd
From 423cbf4ddca6578b87e0f8a3fc425688cd1ca89c Mon Sep 17 00:00:00 2001
d7fdbd
From: Martin Sehnoutka <msehnout@redhat.com>
d7fdbd
Date: Tue, 6 Sep 2016 16:18:39 +0200
d7fdbd
Subject: [PATCH 06/59] Close stdin/out/err before listening for incoming
d7fdbd
 connections.
d7fdbd
d7fdbd
When running vsftpd as a stand-alone FTP daemon, vsftpd
d7fdbd
did not close stdin/out/err. This caused the start script
d7fdbd
to hang waiting for stdin to close. Before this patch was
d7fdbd
applied, one had to hit ctrl+c in order to get shell prompt
d7fdbd
back. Correct behavior:
d7fdbd
$ /etc/init.d/vsftpd start | tee
d7fdbd
Starting vsftpd for vsftpd:                                [  OK  ]
d7fdbd
$
d7fdbd
---
d7fdbd
 standalone.c | 3 +++
d7fdbd
 1 file changed, 3 insertions(+)
d7fdbd
d7fdbd
diff --git a/standalone.c b/standalone.c
d7fdbd
index ba01ab1..e0f2d5b 100644
d7fdbd
--- a/standalone.c
d7fdbd
+++ b/standalone.c
d7fdbd
@@ -130,6 +130,9 @@ vsf_standalone_main(void)
d7fdbd
       die("could not bind listening IPv6 socket");
d7fdbd
     }
d7fdbd
   }
d7fdbd
+  vsf_sysutil_close(0);
d7fdbd
+  vsf_sysutil_close(1);
d7fdbd
+  vsf_sysutil_close(2);
d7fdbd
   retval = vsf_sysutil_listen(listen_sock, VSFTP_LISTEN_BACKLOG);
d7fdbd
   if (vsf_sysutil_retval_is_error(retval))
d7fdbd
   {
d7fdbd
-- 
d7fdbd
2.14.4
d7fdbd