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

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