Re: Reading little endian RPM db files on big endian machine

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

 



[Cross posted to devel list since I think this is a bugfix]

On 4/28/05, Paul Gortmaker <paul.gortmaker@xxxxxxxxx> wrote:
I
> I tried using dbiByteSwapped(dbi)  as an indicator as to when to
> swap, but found it didn't think things were swapped even when they
> were. 

Okay, well we found this, which looks a bit suspect:

dbconfig.c  in db3New:
dbi->dbi_byteswapped = 0;   /* -1 unknown, 0 native order, 1 alien order */

rpmdb.h
int dbiByteSwapped(dbiIndex dbi)
        /*@modifies dbi @*/
{
    if (dbi->dbi_byteswapped == -1)
        dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
    return dbi->dbi_byteswapped;
}

I've set the initialization to -1 in dbconfig and that, combined with
Paul Nasrat's patch (tweaked to go against rpm-4.2.1) and it seems to
pass basic testing.  By the way, is there anon CVS for rpm HEAD?  I
noted the dbconfig.c init value was the same in rpm-4.3.3 and was
interested if it was also the same in HEAD.

Paul.

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux