andykimpe / rpms / 389-ds-base

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

Blame SOURCES/0021-Issue-4418-ldif2db-offline.-Warn-the-user-of-skipped.patch

fec594
From 97bdef2d562e447d521202beb485c3948b0e7214 Mon Sep 17 00:00:00 2001
fec594
From: James Chapman <jachapma@redhat.com>
fec594
Date: Mon, 30 Nov 2020 15:28:05 +0000
fec594
Subject: [PATCH 2/6] Issue 4418 - ldif2db - offline. Warn the user of skipped
fec594
 entries
fec594
fec594
Bug Description: During an ldif2db import entries that do not
fec594
conform to various constraints will be skipped and not imported.
fec594
On completition of an import with skipped entries, the server
fec594
returns a success exit code and logs the skipped entry detail to
fec594
the error logs. The success exit code could lead the user to
fec594
believe that all entries were successfully imported.
fec594
fec594
Fix Description: If a skipped entry occurs during import, the
fec594
import will continue and a warning will be returned to the user.
fec594
fec594
CLI tools for offline import updated to handle warning code.
fec594
fec594
Test added to generate an incorrect ldif entry and perform an
fec594
import.
fec594
fec594
Fixes: #4418
fec594
fec594
Reviewed by: Firstyear, droideck  (Thanks)
fec594
---
fec594
 ldap/servers/slapd/slapi-private.h | 10 ++++++++++
fec594
 1 file changed, 10 insertions(+)
fec594
fec594
diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h
fec594
index 31cb33472..e0092d571 100644
fec594
--- a/ldap/servers/slapd/slapi-private.h
fec594
+++ b/ldap/servers/slapd/slapi-private.h
fec594
@@ -1476,6 +1476,16 @@ typedef enum task_warning_t{
fec594
 int32_t slapi_pblock_get_task_warning(Slapi_PBlock *pb);
fec594
 void slapi_pblock_set_task_warning(Slapi_PBlock *pb, task_warning warn);
fec594
 
fec594
+/* task warnings */
fec594
+typedef enum task_warning_t{
fec594
+    WARN_UPGARDE_DN_FORMAT_ALL    = (1 << 0),
fec594
+    WARN_UPGRADE_DN_FORMAT        = (1 << 1),
fec594
+    WARN_UPGRADE_DN_FORMAT_SPACE  = (1 << 2),
fec594
+    WARN_SKIPPED_IMPORT_ENTRY     = (1 << 3)
fec594
+} task_warning;
fec594
+
fec594
+int32_t slapi_pblock_get_task_warning(Slapi_PBlock *pb);
fec594
+void slapi_pblock_set_task_warning(Slapi_PBlock *pb, task_warning warn);
fec594
 
fec594
 int slapi_exists_or_add_internal(Slapi_DN *dn, const char *filter, const char *entry, const char *modifier_name);
fec594
 
fec594
-- 
fec594
2.26.2
fec594