Blame SOURCES/0023-Issue-51086-Fix-instance-name-length-for-interactive.patch

ab20a9
From 5e0a2d34f1c03a7d6a1c8591896a21e122d90d6b Mon Sep 17 00:00:00 2001
ab20a9
From: Simon Pichugin <spichugi@redhat.com>
ab20a9
Date: Thu, 23 Jul 2020 23:45:18 +0200
ab20a9
Subject: [PATCH] Issue 51086 - Fix instance name length for interactive
ab20a9
 install
ab20a9
ab20a9
Description: Instance name lenght is not properly validated
ab20a9
during interactive install. Add a check during a user input.
ab20a9
ab20a9
https://pagure.io/389-ds-base/issue/51086
ab20a9
ab20a9
Reviewed by: mreynolds (Thanks!)
ab20a9
---
ab20a9
 src/lib389/lib389/instance/setup.py | 3 +++
ab20a9
 1 file changed, 3 insertions(+)
ab20a9
ab20a9
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
ab20a9
index f5fc5495d..45c7dfdd4 100644
ab20a9
--- a/src/lib389/lib389/instance/setup.py
ab20a9
+++ b/src/lib389/lib389/instance/setup.py
ab20a9
@@ -308,6 +308,9 @@ class SetupDs(object):
ab20a9
 
ab20a9
             val = input('\nEnter the instance name [{}]: '.format(slapd['instance_name'])).rstrip()
ab20a9
             if val != "":
ab20a9
+                if len(val) > 80:
ab20a9
+                    print("Server identifier should not be longer than 80 symbols")
ab20a9
+                    continue
ab20a9
                 if not all(ord(c) < 128 for c in val):
ab20a9
                     print("Server identifier can not contain non ascii characters")
ab20a9
                     continue
ab20a9
-- 
ab20a9
2.26.2
ab20a9