Subject: | Removing user from group fails in GroupAdmin if username contains special characters |
Date: | Fri, 02 Mar 2007 17:03:19 -0500 |
To: | bug-HTTPD-User-Manage [...] rt.cpan.org |
From: | Jeff Boes <jeff [...] endpoint.com> |
HTTPD::GroupAdmin version 1.5
Removing a user from a group fails if the username contains any
regex-special characters, e.g., "$".
my $gadm = HTTPD::GroupAdmin->new( ... );
$gadm->delete( 'user$name', 'some_group' );
The erroneous code appears to be here:
sub delete {
my($self,$username,$group) = @_;
$group = $self->{NAME} unless defined $group;
return unless $self->{'_HASH'}->{$group};
$self->{'_HASH'}->{$group} =~ s/(^|$DLM)$username($DLM|$)/$1$2/;
}
I think "$username" should be "\Q$username\E".
--
Jeffery Boes <><
jeff@endpoint.com