* apt-inst/contrib/extracttar.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 12 Jan 2011 23:27:42 +0000 (00:27 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 12 Jan 2011 23:27:42 +0000 (00:27 +0100)
  - let apt-utils work with encoded tar headers if uid/gid are large.
    Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162)

1  2 
apt-pkg/contrib/strutl.cc
apt-pkg/contrib/strutl.h
debian/changelog
test/integration/deb-bug-330162-encoded-tar-header.deb
test/integration/test-bug-330162-encoded-tar-header

@@@ -968,6 -968,24 +968,23 @@@ bool StrToNum(const char *Str,unsigned 
     return true;
  }
                                                                        /*}}}*/
 -bool Base256ToNum(const char *Str,unsigned long &Res,unsigned Len)
+ // Base256ToNum - Convert a fixed length binary to a number             /*{{{*/
+ // ---------------------------------------------------------------------
+ /* This is used in decoding the 256bit encoded fixed length fields in
+    tar files */
 -   int i;
++bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len)
+ {
 -      for(i=1; i<Len; i++)
+    if ((Str[0] & 0x80) == 0)
+       return false;
+    else
+    {
+       Res = Str[0] & 0x7F;
++      for(unsigned int i = 1; i < Len; ++i)
+          Res = (Res<<8) + Str[i];
+       return true;
+    }
+ }
+                                                                       /*}}}*/
  // HexDigit - Convert a hex character into an integer                 /*{{{*/
  // ---------------------------------------------------------------------
  /* Helper for Hex2Num */
@@@ -52,6 -52,7 +52,7 @@@ string LookupTag(const string &Message,
  int StringToBool(const string &Text,int Default = -1);
  bool ReadMessages(int Fd, vector<string> &List);
  bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base = 0);
 -bool Base256ToNum(const char *Str,unsigned long &Res,unsigned Len);
++bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len);
  bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
  bool TokSplitString(char Tok,char *Input,char **List,
                    unsigned long ListMax);
@@@ -1,37 -1,3 +1,40 @@@
-  -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 12 Jan 2011 23:59:38 +0100
 +apt (0.8.11+wheezy) unstable; urgency=low
 +
 +  * apt-pkg/depcache.cc:
 +    - add SetCandidateRelease() to set a candidate version and
 +      the candidates of dependencies if needed to a specified
 +      release (Closes: #572709)
 +  * cmdline/apt-get.cc:
 +    - if --print-uris is used don't setup downloader as we don't need
 +      progress, lock nor the directories it would create otherwise
 +    - show dependencies of essential packages which are going to remove
 +      only if they cause the remove of this essential (Closes: #601961)
 +    - keep not installed garbage packages uninstalled instead of showing
 +      in the autoremove section and installing those (Closes: #604222)
 +    - change pkg/release behavior to use the new SetCandidateRelease
 +      so installing packages from experimental or backports is easier
 +    - really do not show packages in the extra section if they were
 +      requested on the commandline, e.g. with a modifier
 +  * debian/control:
 +    - add Vcs-Browser now that loggerhead works again (Closes: #511168)
 +  * apt-pkg/contrib/fileutl.cc:
 +    - add a RealFileExists method and check that your configuration files
 +      are real files to avoid endless loops if not (Closes: #604401)
 +  * apt-pkg/contrib/weakptr.h:
 +    - include stddefs.h to fix compile error (undefined NULL) with gcc-4.6
 +  * methods/https.cc:
 +    - fix CURLOPT_SSL_VERIFYHOST by really passing 2 to it if enabled
 +  * deb/dpkgpm.cc:
 +    - fix popen/fclose mismatch reported by cppcheck. Thanks to Petter
 +      Reinholdtsen for report and patch! (Closes: #607803)
 +  * doc/apt.conf.5.xml:
 +    - fix multipl{y,e} spelling error reported by Jakub Wilk (Closes: #607636)
++  * apt-inst/contrib/extracttar.cc:
++    - let apt-utils work with encoded tar headers if uid/gid are large.
++      Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162)
 +
++ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 13 Jan 2011 00:25:32 +0100
 +
  apt (0.8.10) unstable; urgency=low
  
    [ Programs translations ]
index 0000000,0000000..f38b1aa
new file mode 100644 (file)
Binary files differ
index 0000000,0000000..fa01e03
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,11 @@@
++#!/bin/sh
++set -e
++
++local TESTDIR=$(readlink -f $(dirname $0))
++. $TESTDIR/framework
++setupenvironment
++configarchitecture "i386"
++
++msgtest 'Test apt-ftparchive with encoded tar header package'
++cp $TESTDIR/deb-bug-330162-encoded-tar-header.deb aptarchive/
++test -z "$(aptftparchive packages aptarchive/ 2>&1 | grep 'E:')" && msgpass || msgfail