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

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