From: Jindrich Novy Date: Tue, 26 Apr 2011 04:33:19 +0000 (+0200) Subject: Understand 'PK00' zip archives (RhBug:699529) X-Git-Tag: tznext/4.11.0.1.tizen20130304~1172 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b352a1de27ff11d4439ab9efdbb9d6074885353;p=tools%2Flibrpm-tizen.git Understand 'PK00' zip archives (RhBug:699529) - it is historically used by PKZIP when storing archive to removable media (floppy), some java apps still use it - thanks to Karel Klic --- diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index 4b81d97..f44eb35 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -360,8 +360,9 @@ int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed) if ((magic[0] == 'B') && (magic[1] == 'Z')) { *compressed = COMPRESSED_BZIP2; - } else if ((magic[0] == 0120) && (magic[1] == 0113) && - (magic[2] == 0003) && (magic[3] == 0004)) { /* pkzip */ + } else if ((magic[0] == 'P') && (magic[1] == 'K') && + (((magic[2] == 3) && (magic[3] == 4)) || + ((magic[2] == '0') && (magic[3] == '0')))) { /* pkzip */ *compressed = COMPRESSED_ZIP; } else if ((magic[0] == 0xfd) && (magic[1] == 0x37) && (magic[2] == 0x7a) && (magic[3] == 0x58) &&