From 0cc86455da9f3883aa691917384c93ffe6c2714b Mon Sep 17 00:00:00 2001 From: Radim Kolar Date: Fri, 5 Jun 2020 20:00:02 +0200 Subject: [PATCH] make sure our inetd fd > 2 - (code) --- server/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/main.c b/server/main.c index b1e070b..9018b3d 100644 --- a/server/main.c +++ b/server/main.c @@ -349,7 +349,10 @@ int main (int argc, char ** argv) /* inetd init */ if(inetd_mode) { - opt=dup(0); + /* make sure that out descriptor is not 0-2, we closing these */ + for( opt=dup(0);opt>-1 && opt<=2; ) { + opt=dup(0); + } } if(daemonize || inetd_mode)