Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 4695
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: michael.bell [...] web.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.86
Fixed in: (no value)



Subject: Wrong group validation
The regex to validate groupnames is wrong. The Debian bugtracking system includes a bug #223383 with a patch for this problem. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=223383 I attached the patch from Debian but I think that the patch is not fully correct. The regex \w+ was changed to \w[-\w]+. I think \w[-\w]* is more correct. System Info: CPAN Version 0.86 (Debian too) Perl v5.8.0 built for i586-linux-thread-multi Linux 2.4.20
--- Server.pm 2003-04-07 06:06:22.000000000 +0200 +++ /usr/share/perl5/Net/Server.pm 2003-12-08 15:43:44.000000000 +0100 @@ -404,7 +404,7 @@ $self->log(1,"Group Not Defined. Defaulting to EGID '$)'\n"); $prop->{group} = $); }else{ - if( $prop->{group} =~ /^(\w+( \w+)*)$/ ){ + if( $prop->{group} =~ /^(\w[-\w]+( \w+)*)$/ ){ $prop->{group} = eval{ get_gid( $1 ) }; $self->fatal( $@ ) if $@; }else{ @@ -418,7 +418,7 @@ $self->log(1,"User Not Defined. Defaulting to EUID '$>'\n"); $prop->{user} = $>; }else{ - if( $prop->{user} =~ /^(\w+)$/ ){ + if( $prop->{user} =~ /^(\w[-\w]+)$/ ){ $prop->{user} = eval{ get_uid( $1 ) }; $self->fatal( $@ ) if $@; }else{
From: michael.bell [...] web.de
updated server.diff with fixed regex
--- Net-Server-0.86/lib/Net/Server.pm 2003-11-06 21:04:11.000000000 +0100 +++ Net-Server-0.86/lib/Net/Server.pm.new 2003-12-17 09:42:15.000000000 +0100 @@ -404,7 +404,7 @@ $self->log(1,"Group Not Defined. Defaulting to EGID '$)'\n"); $prop->{group} = $); }else{ - if( $prop->{group} =~ /^(\w+( \w+)*)$/ ){ + if( $prop->{group} =~ /^(\w[-\w]*( \w[-\w]*)*)$/ ){ $prop->{group} = eval{ get_gid( $1 ) }; $self->fatal( $@ ) if $@; }else{ @@ -418,7 +418,7 @@ $self->log(1,"User Not Defined. Defaulting to EUID '$>'\n"); $prop->{user} = $>; }else{ - if( $prop->{user} =~ /^(\w+)$/ ){ + if( $prop->{user} =~ /^(\w[-\w]*)$/ ){ $prop->{user} = eval{ get_uid( $1 ) }; $self->fatal( $@ ) if $@; }else{