Re: [libosinfo PATCH 3/3] db: improve _guess_os_from_tree checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 10, 2018 at 02:05:06PM +0100, Fabiano Fidêncio wrote:
> On Mon, Dec 10, 2018 at 1:57 PM Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> >
> > Hey,
> >
> > On Sun, Dec 02, 2018 at 04:37:59PM +0100, Fabiano Fidêncio wrote:
> > > Do not check against a distro that has all the treeinfo attribute as
> > > NULL as match_regex() would just match whatever we compare to it.
> >
> > When can this happen?
> 
> When testing *any* distro :-)
> 
> For instance, in osinfo_db_guess_from_os_tree() we go through the list
> of OSes testing against the one we passed, right? So, here the one
> passed is the "regex" for the match_regex() and the info we get from
> the OS is the "pattern".
> Considering this ... we end up testing, for instance, against Fedora 6
> which doesn't have the treeinfo fields. Then, if you take a look at
> match_regex() code, you'll find out that we just return "true" in case
> the pattern is NULL.
> 
> So, in the end, we should only try to match the treeinfo when the
> system we're trying to match to provides treeinfo.

I believe this last paragraph is what I was asking :) If we are trying
to match something which does not have treeinfo defined, we'll be
getting NULL for all the calls (and what I was trying to understand was
if we would be getting NULL values only in odd/invalid databases, or
even in the nominal case, now I understand it's the latter).

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux