bug-cfengine
[Top][All Lists]
Advanced

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

Re: Patch to fix bad version comparison in RPMPackageCheck()


From: Phil D'Amore
Subject: Re: Patch to fix bad version comparison in RPMPackageCheck()
Date: Mon, 28 Feb 2005 16:47:22 -0500

OK, here we go...

After looking at this, I decided it is broken because rpmvercmp is not
honoring its contract to only return 1, 0, or -1.  Attached is a patch
that fixes rpmvercmp(), as well as the original problems I found.

Steve, can you try this guy out to see if it deals properly with your
RHL 7.3 problem?

Thanks for noticing this.

On Mon, 2005-02-28 at 15:20, address@hidden wrote:
>  > Have you found a case where strcmp() returns something other than that
>  > on one of your machines?
> 
> strcmp("1",x) for (almost all?) values of x>2 on RH7.3
> 
> and, like i said before, strcmp("42","44") is -2 on RH7.3!
> 
> couldn't find any in FC3 after about 150,000 tries.
> 
> steve 
> - - - 
> systems & network manager
> high energy physics
> university of wisconsin
> 
> ginseng(rader): cat /etc/redhat-release
> Red Hat Linux release 7.3 (Valhalla) UW-HEP $Revision 1.9$
> 
> ginseng(rader): cat strcmp.c 
> main (char *argc, char **argv) {
>   int i;
>   i = strcmp(argv[1],argv[2]);
>   printf("strcmp %s %s is %d\n",argv[1],argv[2],i);
> }
> 
> ginseng(rader): cc -o strcmp strcmp.c 
> 
> ginseng(rader): ./strcmp 42 44
> strcmp 42 44 is -2
-- 
Phil D'Amore                             "Sometimes there is a fine line
Senior System Administrator               between criminally abusive
Red Hat, Inc                              behavior and fun."
Office: 919.754.3700 x44395                 -- Ted the Generic Guy
Pager: 877.383.8795                            (Dilbert 4/19/2003)

Attachment: cfengine-2.1.13-rpmpackagecheck.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]