store got a few more validations
(a full scan of all input data is pending; this is just for diagnostics)
This commit is contained in:
parent
7f8020adc5
commit
356ff2b757
|
@ -49,6 +49,7 @@ my %ignored;
|
||||||
sub add_to_group {
|
sub add_to_group {
|
||||||
my ( $lhs, @rhs ) = @_;
|
my ( $lhs, @rhs ) = @_;
|
||||||
_die "bad group '$lhs'" unless $lhs =~ $REPONAME_PATT;
|
_die "bad group '$lhs'" unless $lhs =~ $REPONAME_PATT;
|
||||||
|
map { _die "bad expansion '$_'" unless $_ =~ $REPOPATT_PATT } @rhs;
|
||||||
|
|
||||||
# store the group association, but overload it to keep track of when
|
# store the group association, but overload it to keep track of when
|
||||||
# the group was *first* created by using $subconf as the *value*
|
# the group was *first* created by using $subconf as the *value*
|
||||||
|
@ -115,6 +116,8 @@ sub parse_users {
|
||||||
|
|
||||||
sub add_rule {
|
sub add_rule {
|
||||||
my ( $perm, $ref, $user ) = @_;
|
my ( $perm, $ref, $user ) = @_;
|
||||||
|
_die "bad ref '$ref'" unless $ref =~ $REPOPATT_PATT;
|
||||||
|
_die "bad user '$user'" unless $user =~ $USERNAME_PATT;
|
||||||
|
|
||||||
$ruleseq++;
|
$ruleseq++;
|
||||||
for my $repo (@repolist) {
|
for my $repo (@repolist) {
|
||||||
|
@ -140,6 +143,7 @@ sub add_rule {
|
||||||
|
|
||||||
sub set_subconf {
|
sub set_subconf {
|
||||||
$subconf = shift;
|
$subconf = shift;
|
||||||
|
_die "bad subconf '$subconf'" unless $subconf =~ /^[-\w.]+$/;
|
||||||
trace( 1, $subconf );
|
trace( 1, $subconf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue