Blame SOURCES/0020-Ticket-48934-remove-ds.pl-deletes-an-instance-even-i.patch

7c7f29
From 8f761940cb93fc8e64ed9022c3a6f21e90c281aa Mon Sep 17 00:00:00 2001
7c7f29
From: Noriko Hosoi <nhosoi@redhat.com>
7c7f29
Date: Wed, 27 Jul 2016 12:40:25 -0700
7c7f29
Subject: [PATCH 20/29] Ticket #48934 - remove-ds.pl deletes an instance even
7c7f29
 if wrong prefix was specified
7c7f29
7c7f29
Description: remove-ds.pl skipped to check "slapd" part of "slapd-instance".
7c7f29
This patch adds the check and if it is not "slapd", it quits with the error
7c7f29
message.  For example:
7c7f29
Error: Invalid instance name "bogus-test"
7c7f29
7c7f29
https://fedorahosted.org/389/ticket/48934
7c7f29
7c7f29
Reviewed by mreynolds@redhat.com (Thanks, Mark!!)
7c7f29
7c7f29
(cherry picked from commit 2b341922a42f305122fbd6eb97e96e0612f8e5d2)
7c7f29
---
7c7f29
 ldap/admin/src/scripts/remove-ds.pl.in | 4 ++++
7c7f29
 1 file changed, 4 insertions(+)
7c7f29
7c7f29
diff --git a/ldap/admin/src/scripts/remove-ds.pl.in b/ldap/admin/src/scripts/remove-ds.pl.in
7c7f29
index b35ae32..252f3f9 100755
7c7f29
--- a/ldap/admin/src/scripts/remove-ds.pl.in
7c7f29
+++ b/ldap/admin/src/scripts/remove-ds.pl.in
7c7f29
@@ -52,6 +52,10 @@ unless ($inst) {
7c7f29
     print STDERR "Full instance name must be specified (e.g. - slapd-example)\n";
7c7f29
     exit 1;
7c7f29
 }
7c7f29
+unless ($slapd eq "slapd") {
7c7f29
+    print STDERR "Error: Invalid instance name \"$instname\"\n";
7c7f29
+    exit 1;
7c7f29
+}
7c7f29
 
7c7f29
 my @errs = removeDSInstance($inst, $force, $all, $initconfig_dir);
7c7f29
 if (@errs) {
7c7f29
-- 
7c7f29
2.4.11
7c7f29