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

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