From 7b352a1de27ff11d4439ab9efdbb9d6074885353 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Tue, 26 Apr 2011 06:33:19 +0200 Subject: [PATCH] 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 --- rpmio/rpmfileutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) && -- 2.7.4