[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    PATCH: KTar Does Not Recognize Differently Enabled Checksums
From:       Robert Hogan <robert () roberthogan ! net>
Date:       2006-07-16 16:58:52
Message-ID: 200607161758.53002.robert () roberthogan ! net
[Download RAW message or body]

Following on from my disregarded yelp a couple of days ago I've wasted an hour 
or two of a beautiful sunny Sunday afternoon figuring out KTar's difficulty 
with funny checksums.

Whatever the crew at Dante have used to tarball their source, 
it 'right-justifies' checksum values in the checksum field so that what would 
normally appear as 010334 appears as 0010334.

The attached fixes this for KTar by trying to match the checksum in three 
different positions on the header block rather than just the one. 

Can you please, please commit this for the next bugfix release of 3.5 as I'd 
like to be able to offer users of my app the ability to download and compile 
dante - and this bug is preventing it.

Please... think of the children.

-- 

KlamAV - An Anti-Virus Manager for KDE - http://www.klamav.net
TorK   - A Tor Controller For KDE      - http://tork.sf.net

["ktar.patch" (text/x-diff)]

--- ktar.cpp	2006-07-16 17:49:08.000000000 +0100
+++ ktar-mod.cpp	2006-07-16 17:50:03.000000000 +0100
@@ -176,7 +176,10 @@
 
       // only compare those of the 6 checksum digits that mean something,
       // because the other digits are filled with all sorts of different chars by \
                different tars ...
-      if( strncmp( buffer + 148 + 6 - s.length(), s.data(), s.length() ) ) {
+      // Some tars right-justify the checksum so it could start in one of three \
places - we have to check each. +      if( strncmp( buffer + 148 + 6 - s.length(), \
s.data(), s.length() ) +        && strncmp( buffer + 148 + 7 - s.length(), s.data(), \
s.length() ) +        && strncmp( buffer + 148 + 8 - s.length(), s.data(), s.length() \
                ) ) {
         kWarning(7041) << "KTar: invalid TAR file. Header is: " << QByteArray( \
                buffer+257, 5 )
                        << " instead of ustar. Reading from wrong pos in file?"
                        << " checksum=" << QByteArray( buffer + 148 + 6 - s.length(), \
s.length() ) << endl;



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic