diff -up smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists.delete smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists --- smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists.delete 2013-12-10 23:29:27.000000000 -0500 +++ smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists 2013-12-10 23:30:15.000000000 -0500 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -wT #---------------------------------------------------------------------- # heading : Collaboration @@ -395,13 +395,31 @@ sub performDeleteList ($) # Attempt to delete list #------------------------------------------------------------ my $listName = $q->param ('list'); + if ($listName =~ /^([a-z][a-z\-0-9]*)$/) + { + $listName = $1; + } + else + { + showInitial ($q, + "Error: unexpected characters in list name: " . + "\"$listName\". The list name should contain only " . + "lower-case letters, numbers and hypens, and " . + "must start " . + "with a lower-case letter. For example \"betty\", " . + "\"hjohnson\", and \"abc-12\" are all valid list " . + "names, but \"3friends\", \"John Smith\" and " . + "\"Henry-Miller\" are not."); + return; + } + my $list = $accounts->get($listName); if ($list) { system ('/sbin/e-smith/signal-event', 'mailinglist-delete', $listName) == 0 or die ("Error occurred while deleting list.\n"); $list->delete; - showInitial ($q, "Successfully deleted mailing list $list."); + showInitial ($q, "Successfully deleted mailing list $listName."); } }