[virt-tools-list] [PATCH] Fix regex matching for OS media

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Thu Feb 23 12:48:11 UTC 2012


On Thu, Feb 23, 2012 at 1:10 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> The current regex match rule is
>
>   If pattern is NULL and string is NULL
>      -> accept media
>   else if pattern is NULL or string is NULL
>      -> reject media
>   else
>      -> do regex compare
>
> The regex match rules ought to be
>
>   If pattern is NULL
>       -> accept media
>   Else if string is NULL
>       -> reject media
>   else
>       -> do regex compare
>
> The idea is that if the Osinfo database pattern is NULL, then
> regardless of whether the string is NULL or not, then we should
> allow that match. In effect a pattern == NULL, should be treated
> as equivalent to a regex ".*"

Sounds correct to me, ACK!

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the virt-tools-list mailing list