From 2b341922a42f305122fbd6eb97e96e0612f8e5d2 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Jul 28 2016 04:18:12 +0000 Subject: Ticket #48934 - remove-ds.pl deletes an instance even if wrong prefix was specified Description: remove-ds.pl skipped to check "slapd" part of "slapd-instance". This patch adds the check and if it is not "slapd", it quits with the error message. For example: Error: Invalid instance name "bogus-test" https://fedorahosted.org/389/ticket/48934 Reviewed by mreynolds@redhat.com (Thanks, Mark!!) --- diff --git a/ldap/admin/src/scripts/remove-ds.pl.in b/ldap/admin/src/scripts/remove-ds.pl.in index b35ae32..252f3f9 100755 --- a/ldap/admin/src/scripts/remove-ds.pl.in +++ b/ldap/admin/src/scripts/remove-ds.pl.in @@ -52,6 +52,10 @@ unless ($inst) { print STDERR "Full instance name must be specified (e.g. - slapd-example)\n"; exit 1; } +unless ($slapd eq "slapd") { + print STDERR "Error: Invalid instance name \"$instname\"\n"; + exit 1; +} my @errs = removeDSInstance($inst, $force, $all, $initconfig_dir); if (@errs) {