andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 6 months ago
Clone

Blame SOURCES/0022-Issue-51188-db2ldif-crashes-when-LDIF-file-can-t-be-.patch

d69b2b
From d24381488a997dda0006b603fb2b452b726757c0 Mon Sep 17 00:00:00 2001
d69b2b
From: Simon Pichugin <simon.pichugin@gmail.com>
d69b2b
Date: Thu, 25 Jun 2020 10:45:16 +0200
d69b2b
Subject: [PATCH] Issue 51188 - db2ldif crashes when LDIF file can't be
d69b2b
 accessed
d69b2b
d69b2b
Bug Description: db2ldif crashes when we set '-a LDIF_PATH' to a place that
d69b2b
can't be accessed by the user (dirsrv by default)
d69b2b
d69b2b
Fix Description: Don't attempt to close DB if we bail after a failed
d69b2b
attempt to open LDIF file.
d69b2b
d69b2b
https://pagure.io/389-ds-base/issue/51188
d69b2b
d69b2b
Reviewed by: mreynolds (Thanks!)
d69b2b
---
d69b2b
 ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c | 1 +
d69b2b
 1 file changed, 1 insertion(+)
d69b2b
d69b2b
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c
d69b2b
index 542147c3d..9ffd877cb 100644
d69b2b
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c
d69b2b
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c
d69b2b
@@ -871,6 +871,7 @@ bdb_db2ldif(Slapi_PBlock *pb)
d69b2b
             slapi_log_err(SLAPI_LOG_ERR, "bdb_db2ldif",
d69b2b
                     "db2ldif: %s: can't open %s: %d (%s) while running as user \"%s\"\n",
d69b2b
                     inst->inst_name, fname, errno, dblayer_strerror(errno), slapdFrontendConfig->localuserinfo->pw_name);
d69b2b
+            we_start_the_backends = 0;
d69b2b
             return_value = -1;
d69b2b
             goto bye;
d69b2b
         }
d69b2b
-- 
d69b2b
2.26.2
d69b2b