[PATCH] nss: Ignore stayopen flag and keep the db open

Ponnuvel Palaniyappan pponnuvel@gmail.com
Tue Oct 21 06:18:15 GMT 2025


Currently the DB file is opened and closed for processing
each of the entries in the DB file. This results in considerably
poor performance in environments with large DB files.

Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com>
---
 nss/nss_db/db-XXX.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c
index 9769d49d77..227e3de438 100644
--- a/nss/nss_db/db-XXX.c
+++ b/nss/nss_db/db-XXX.c
@@ -73,8 +73,8 @@ CONCAT(_nss_db_set,ENTNAME) (int stayopen)
 
   if (status == NSS_STATUS_SUCCESS)
     {
-      /* Remember STAYOPEN flag.  */
-      keep_db |= stayopen;
+      /* Ignore STAYOPEN flag.  */
+      keep_db |= 1;
 
       /* Reset the sequential index.  */
       entidx  = NULL;
-- 
2.43.0



More information about the Libc-alpha mailing list