From 632e75a480f2eb4ec8adc19f44c0edc6479f7d71 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Fri, 5 Dec 2014 12:43:49 +0100 Subject: [PATCH] handle user names with unusual characters (e.g. periods) (RT #85586) --- lib/Net/Server.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Net/Server.pm b/lib/Net/Server.pm index 59fb44e..f25786a 100644 --- a/lib/Net/Server.pm +++ b/lib/Net/Server.pm @@ -350,11 +350,9 @@ sub post_bind { # secure the process and background it if (! defined $prop->{'user'}) { $self->log(1, "User Not Defined. Defaulting to EUID '$>'"); $prop->{'user'} = $>; - } elsif ($prop->{'user'} =~ /^([\w-]+)$/) { - $prop->{'user'} = eval { get_uid($1) }; - $self->fatal(my $e = $@) if $@; } else { - $self->fatal("Invalid user \"$prop->{'user'}\""); + $prop->{'user'} = eval { get_uid($prop->{'user'}) }; + $self->fatal(my $e = $@) if $@; } # chown any files or sockets that we need to -- 2.1.2