Skip to content

Commit

Permalink
[backend] enforce a couple of length restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Nov 22, 2012
1 parent 2b18259 commit 49b0744
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/backend/BSVerify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sub verify_projid {
die("projid is empty\n") unless defined($projid) && $projid ne '';
die("projid '$projid' is illegal\n") if $projid =~ /[\/\000-\037]/;
die("projid '$projid' is illegal\n") if ":$projid:" =~ /:[_\.:]/;
die("projid '$projid' is too long\n") if length($projid) > 200;
}

sub verify_projkind {
Expand All @@ -43,13 +44,15 @@ sub verify_packid {
$packid =~ s/^_patchinfo://s;
die("packid '$packid' is illegal\n") if $packid =~ /[\/:\000-\037]/;
die("packid '$packid' is illegal\n") if $packid =~ /^[_\.]/ && $packid ne '_product' && $packid ne '_pattern' && $packid ne '_project' && $packid ne '_patchinfo';
die("packid '$packid' is too long\n") if length($packid) > 200;
}

sub verify_repoid {
my $repoid = $_[0];
die("repoid is empty\n") unless defined($repoid) && $repoid ne '';
die("repoid '$repoid' is illegal\n") if $repoid =~ /[\/:\000-\037]/;
die("repoid '$repoid' is illegal\n") if $repoid =~ /^[_\.]/;
die("repoid '$repoid' is too long\n") if length($repoid) > 200;
}

sub verify_jobid {
Expand All @@ -63,6 +66,7 @@ sub verify_arch {
my $arch = $_[0];
die("arch is empty\n") unless defined($arch) && $arch ne '';
die("arch '$arch' is illegal\n") if $arch =~ /[\/:\.\000-\037]/;
die("arch '$arch' is too long\n") if length($arch) > 200;
verify_simple($arch);
}

Expand Down

0 comments on commit 49b0744

Please sign in to comment.