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

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