]> git.saurik.com Git - apt.git/blobdiff - apt-inst/contrib/extracttar.cc
Configurable max values to use with dpkg
[apt.git] / apt-inst / contrib / extracttar.cc
index 57e083b5a39bfa5bc78f3e7a0d04a755f6a2742f..e0feaee122781c3e7f4f9ef9a98ae42c38ae6f48 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: extracttar.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $
+// $Id: extracttar.cc,v 1.5 2002/03/26 07:38:58 jgg Exp $
 /* ######################################################################
 
    Extract a Tar - Tar Extractor
@@ -30,8 +30,9 @@
 #include <unistd.h>
 #include <signal.h>
 #include <fcntl.h>
+#include <iostream>
                                                                        /*}}}*/
-
+    
 // The on disk header for a tar file.
 struct ExtractTar::TarHeader
 {
@@ -68,7 +69,8 @@ ExtractTar::ExtractTar(FileFd &Fd,unsigned long Max) : File(Fd),
 /* */
 ExtractTar::~ExtractTar()
 {
-   Done(false);
+   // Error close
+   Done(true);
 }
                                                                        /*}}}*/
 // ExtractTar::Done - Reap the gzip sub process                                /*{{{*/
@@ -189,11 +191,9 @@ bool ExtractTar::Go(pkgDirStream &Stream)
    
       // Decode all of the fields
       pkgDirStream::Item Itm;
-      unsigned long UID;
-      unsigned long GID;
       if (StrToNum(Tar->Mode,Itm.Mode,sizeof(Tar->Mode),8) == false ||
-         StrToNum(Tar->UserID,UID,sizeof(Tar->UserID),8) == false ||
-         StrToNum(Tar->GroupID,GID,sizeof(Tar->GroupID),8) == false ||
+         StrToNum(Tar->UserID,Itm.UID,sizeof(Tar->UserID),8) == false ||
+         StrToNum(Tar->GroupID,Itm.GID,sizeof(Tar->GroupID),8) == false ||
          StrToNum(Tar->Size,Itm.Size,sizeof(Tar->Size),8) == false ||
          StrToNum(Tar->MTime,Itm.MTime,sizeof(Tar->MTime),8) == false ||
          StrToNum(Tar->Major,Itm.Major,sizeof(Tar->Major),8) == false ||