Skip to content

Commit

Permalink
rpc: gendispatch: handle empty flags
Browse files Browse the repository at this point in the history
CVE-2020-25637

Prepare for omission of the <flagname> in remote_protocol.x
@acl annotations:
 @acl: <object>:<permission>:<flagname>
so that we can add more fields after, e.g.:
 @acl: <object>:<permission>::<field>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
  • Loading branch information
janotomko committed Sep 30, 2020
1 parent 9c2ba74 commit 955029b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/gendispatch.pl
Expand Up @@ -2119,7 +2119,7 @@ sub hyper_to_long
if ($acl[$i]->{object} ne $acl[0]->{object}) {
die "acl for '$call->{ProcName}' cannot check different objects";
}
if (defined $acl[$i]->{flags}) {
if (defined $acl[$i]->{flags} && length $acl[$i]->{flags}) {
$checkflags = 1;
}
}
Expand Down Expand Up @@ -2207,7 +2207,7 @@ sub hyper_to_long
my $method = "virAccessManagerCheck" . $object;
my $space = ' ' x length($method);
print " if (";
if (defined $acl->{flags}) {
if (defined $acl->{flags} && length $acl->{flags}) {
my $flags = $acl->{flags};
if ($flags =~ /^\!/) {
$flags = substr $flags, 1;
Expand Down

0 comments on commit 955029b

Please sign in to comment.