From 1c9b021e78dc67b9cdca5f9ad10cbde08418ee28 Mon Sep 17 00:00:00 2001
From: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon, 10 Oct 2022 23:15:06 +0200
Subject: [PATCH] Fix off-by one error in closing file descriptors

This could leave file descriptor 3 open from the parent process starting
nslcd.
---
 nslcd/daemonize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nslcd/daemonize.c b/nslcd/daemonize.c
index d11d358..be3b386 100644
--- a/nslcd/daemonize.c
+++ b/nslcd/daemonize.c
@@ -50,7 +50,7 @@ void daemonize_closefds(void)
      hope we closed enough */
   if (i < 0)
     i = 32;
-  for (; i > 3; i--)
+  for (; i > 2; i--)
     close(i);
 }
 
-- 
2.27.0

