[Pkg-privacy-commits] [msva-perl] 122/356: tighten up regexps for context and peer
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository msva-perl.
commit 142c92d50ad1f0b7e7de02da8e67d96cccb4a5cd
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Sat Oct 2 17:38:27 2010 -0400
tighten up regexps for context and peer
---
msva-perl | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/msva-perl b/msva-perl
index 4647721..a0ebe58 100755
--- a/msva-perl
+++ b/msva-perl
@@ -23,6 +23,7 @@ use strict;
use parent qw(HTTP::Server::Simple::CGI);
require Crypt::X509;
+ use Regexp::Common qw /net/;
use Convert::ASN1;
use MIME::Base64;
use IO::Socket;
@@ -326,17 +327,13 @@ use strict;
sub getuid {
my $data = shift;
- if ($data->{context} =~ /(https|ssh)/) {
+ if ($data->{context} =~ /^(https|ssh)$/) {
$data->{context} = $1;
- } else {
- return [];
- }
- if ($data->{peer} =~ /(^[^\s]*$)/) {
- $data->{peer} = $1;
- } else {
- return [];
+ if ($data->{peer} =~ /^($RE{net}{domain})$/) {
+ $data->{peer} = $1;
+ return $data->{context}.'://'.$data->{peer};
+ }
}
- return $data->{context}.'://'.$data->{peer};
}
sub reviewcert {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git
More information about the Pkg-privacy-commits
mailing list