[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#566664: marked as done (apt-ftparchive segfaults on hurd-i386)



Your message dated Wed, 27 Jan 2010 21:32:58 +0000
with message-id <E1NaFVS-0002XG-9p@ries.debian.org>
and subject line Bug#566664: fixed in apt 0.7.25.2
has caused the Debian Bug report #566664,
regarding apt-ftparchive segfaults on hurd-i386
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
566664: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566664
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 0.7.25
Severity: important
Tags: patch

Hello,

apt-ftparchive currently crashes because the case when
pathconf(".",_PC_PATH_MAX); returns -1 (no limit) is not properly
handled. The attached patch replaces it with just using glibc's
realpath(path, NULL) feature (which got into POSIX 2008 btw).

Samuel

-- Package-specific info:

-- (no /etc/apt/preferences present) --


-- (/etc/apt/sources.list present, but not submitted) --


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt depends on:
ii  debian-archive-keyring  2009.01.31       GnuPG archive keys of the Debian a
ii  libc6                   2.10.2-2         GNU C Library: Shared libraries
ii  libgcc1                 1:4.5-20091226-1 GCC support library
ii  libstdc++6              4.4.2-9          The GNU Standard C++ Library v3

apt recommends no packages.

Versions of packages apt suggests:
pn  apt-doc                   <none>         (no description available)
ii  aptitude                  0.4.11.11-1+b2 terminal-based package manager
ii  bzip2                     1.0.5-3        high-quality block-sorting file co
ii  dpkg-dev                  1.15.5.6       Debian package development tools
ii  lzma                      4.43-14        Compression method of 7z format in
ii  python-apt                0.7.13.3       Python interface to libapt-pkg
ii  synaptic                  0.63           Graphical package manager

-- no debconf information

-- 
Samuel Thibault <samuel.thibault@fnac.net>
R: Parce que a renverse btement l'ordre naturel de lecture!
Q: Mais pourquoi citer en fin d'article est-il si effroyable?
R: Citer en fin d'article
Q: Quelle est la chose la plus dsagrable sur les groupes de news?
diff -ur tmp/apt-0.7.25.1/ftparchive/writer.cc apt-0.7.25.1/ftparchive/writer.cc
--- tmp/apt-0.7.25.1/ftparchive/writer.cc	2010-01-09 20:56:01.000000000 +0000
+++ apt-0.7.25.1/ftparchive/writer.cc	2010-01-24 12:27:55.000000000 +0000
@@ -58,10 +58,6 @@
 {
    ErrorPrinted = false;
    NoLinkAct = !_config->FindB("APT::FTPArchive::DeLinkAct",true);
-   RealPath = 0;
-   long PMax = pathconf(".",_PC_PATH_MAX);
-   if (PMax > 0)
-      RealPath = new char[PMax];
 }
 									/*}}}*/
 // FTWScanner::Scanner - FTW Scanner					/*{{{*/
@@ -92,6 +88,8 @@
 int FTWScanner::ScannerFile(const char *File, bool ReadLink)
 {
    const char *LastComponent = strrchr(File, '/');
+   char *RealPath;
+
    if (LastComponent == NULL)
       LastComponent = File;
    else
@@ -111,10 +109,13 @@
       given are not links themselves. */
    char Jnk[2];
    Owner->OriginalPath = File;
-   if (ReadLink && Owner->RealPath != 0 &&
+   if (ReadLink &&
        readlink(File,Jnk,sizeof(Jnk)) != -1 &&
-       realpath(File,Owner->RealPath) != 0)
-      Owner->DoPackage(Owner->RealPath);
+       (RealPath = realpath(File,NULL)) != 0)
+   {
+      Owner->DoPackage(RealPath);
+      free(RealPath);
+   }
    else
       Owner->DoPackage(File);
    
@@ -150,13 +151,15 @@
 /* */
 bool FTWScanner::RecursiveScan(string Dir)
 {
+   char *RealPath;
    /* If noprefix is set then jam the scan root in, so we don't generate
       link followed paths out of control */
    if (InternalPrefix.empty() == true)
    {
-      if (realpath(Dir.c_str(),RealPath) == 0)
+      if ((RealPath = realpath(Dir.c_str(),NULL)) == 0)
 	 return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
-      InternalPrefix = RealPath;      
+      InternalPrefix = RealPath;
+      free(RealPath);
    }
    
    // Do recursive directory searching
@@ -180,13 +183,15 @@
    of files from another file. */
 bool FTWScanner::LoadFileList(string Dir,string File)
 {
+   char *RealPath;
    /* If noprefix is set then jam the scan root in, so we don't generate
       link followed paths out of control */
    if (InternalPrefix.empty() == true)
    {
-      if (realpath(Dir.c_str(),RealPath) == 0)
+      if ((RealPath = realpath(Dir.c_str(),NULL)) == 0)
 	 return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
       InternalPrefix = RealPath;      
+      free(RealPath);
    }
    
    Owner = this;
@@ -668,6 +673,7 @@
    // Perform the delinking operation over all of the files
    string ParseJnk;
    const char *C = Files;
+   char *RealPath;
    for (;isspace(*C); C++);
    while (*C != 0)
    {   
@@ -679,10 +685,11 @@
       
       char Jnk[2];
       string OriginalPath = Directory + ParseJnk;
-      if (RealPath != 0 && readlink(OriginalPath.c_str(),Jnk,sizeof(Jnk)) != -1 &&
-	  realpath(OriginalPath.c_str(),RealPath) != 0)
+      if (readlink(OriginalPath.c_str(),Jnk,sizeof(Jnk)) != -1 &&
+	  (RealPath = realpath(OriginalPath.c_str(),NULL)) != 0)
       {
 	 string RP = RealPath;
+	 free(RealPath);
 	 if (Delink(RP,OriginalPath.c_str(),Stats.DeLinkBytes,St.st_size) == false)
 	    return false;
       }
diff -ur tmp/apt-0.7.25.1/ftparchive/writer.h apt-0.7.25.1/ftparchive/writer.h
--- tmp/apt-0.7.25.1/ftparchive/writer.h	2010-01-09 20:56:01.000000000 +0000
+++ apt-0.7.25.1/ftparchive/writer.h	2010-01-24 12:15:13.000000000 +0000
@@ -35,7 +35,6 @@
    protected:
    vector<string> Patterns;
    const char *OriginalPath;
-   char *RealPath;
    bool ErrorPrinted;
    
    // Stuff for the delinker
@@ -70,7 +69,6 @@
    bool SetExts(string Vals);
       
    FTWScanner();
-   virtual ~FTWScanner() {delete [] RealPath;};
 };
 
 class PackagesWriter : public FTWScanner

--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.7.25.2

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:

apt-doc_0.7.25.2_all.deb
  to main/a/apt/apt-doc_0.7.25.2_all.deb
apt-transport-https_0.7.25.2_i386.deb
  to main/a/apt/apt-transport-https_0.7.25.2_i386.deb
apt-utils_0.7.25.2_i386.deb
  to main/a/apt/apt-utils_0.7.25.2_i386.deb
apt_0.7.25.2.dsc
  to main/a/apt/apt_0.7.25.2.dsc
apt_0.7.25.2.tar.gz
  to main/a/apt/apt_0.7.25.2.tar.gz
apt_0.7.25.2_i386.deb
  to main/a/apt/apt_0.7.25.2_i386.deb
libapt-pkg-dev_0.7.25.2_i386.deb
  to main/a/apt/libapt-pkg-dev_0.7.25.2_i386.deb
libapt-pkg-doc_0.7.25.2_all.deb
  to main/a/apt/libapt-pkg-doc_0.7.25.2_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 566664@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 27 Jan 2010 16:16:10 +0100
Source: apt
Binary: apt apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source all i386
Version: 0.7.25.2
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description: 
 apt        - Advanced front-end for dpkg
 apt-doc    - Documentation for APT
 apt-transport-https - APT https transport
 apt-utils  - APT utility programs
 libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - Documentation for APT development
Closes: 475770 534920 548884 549312 558348 561636 565213 566664
Changes: 
 apt (0.7.25.2) unstable; urgency=low
 .
   [ Michael Vogt ]
   * apt-pkg/contrib/cdromutl.cc:
     - fix UnmountCdrom() fails, give it a bit more time and try
       the umount again
   * apt-pkg/cdrom.cc:
     - fix crash in pkgUdevCdromDevices
   * methods/cdrom.cc:
     - fixes in multi cdrom setup code (closes: #549312)
     - add new "Acquire::cdrom::AutoDetect" config that enables/disables
       the dlopen of libudev for automatic cdrom detection. Off by default
       currently, feedback/testing welcome
   * cmdline/apt-cdrom.cc:
     - add new --auto-detect option that uses libudev to figure out
       the cdrom/mount-point
   * cmdline/apt-mark:
     - merge fix from Gene Cash that supports markauto for
       packages that are not in the extended_states file yet
       (closes: #534920)
   * ftparchive/writer.{cc,h}:
     - merge crash fix for apt-ftparchive on hurd, thanks to
       Samuel Thibault for the patch (closes: #566664)
 .
   [ David Kalnischkies ]
   * apt-pkg/contrib/fileutl.cc:
     - Fix the newly introduced method GetListOfFilesInDir to not
       accept every file if no extension is enforced
       (= restore old behaviour). (Closes: #565213)
   * apt-pkg/policy.cc:
     - accept also partfiles with "pref" file extension as valid
   * apt-pkg/contrib/configuration.cc:
     - accept also partfiles with "conf" file extension as valid
   * doc/apt.conf.5.xml:
     - reorder description and split out syntax
     - add partfile name convention (Closes: #558348)
   * doc/apt_preferences.conf.5.xml:
     - describe partfile name convention also here
   * apt-pkg/deb/dpkgpm.cc:
     - don't segfault if term.log file can't be opened.
       Thanks Sam Brightman for the patch! (Closes: #475770)
   * doc/*:
     - replace the per language addendum with a global addendum
     - add a explanation why translations include (maybe) english
       parts to the new global addendum (Closes: #561636)
   * apt-pkg/contrib/strutl.cc:
     - fix malloc asseration fail with ja_JP.eucJP locale in
       apt-cache search. Thanks Kusanagi Kouichi! (Closes: #548884)
 .
   [ Christian Perrier ]
   * French translation update
Checksums-Sha1: 
 ac8305749e6789a9a561cd9c4d63ea422944308f 1212 apt_0.7.25.2.dsc
 fa713204e67a625b8e49a400d3469e8daa9896a0 2646304 apt_0.7.25.2.tar.gz
 db9709015dc7d2b6f9ad184d58e1a749f4f20f0b 138688 apt-doc_0.7.25.2_all.deb
 db2869f81e2a06dd19eb634b06d737911019c77d 133138 libapt-pkg-doc_0.7.25.2_all.deb
 b4d1feefb88a0a08abf4c5a04c3f87968d139f6d 1749128 apt_0.7.25.2_i386.deb
 963550225280eb30c45a6f4736675db53b459037 121454 libapt-pkg-dev_0.7.25.2_i386.deb
 c687ff00e73f52557257e5041d94ccde83ae793f 223736 apt-utils_0.7.25.2_i386.deb
 bd524432662e1625d774e723f9ba6db9950ff0d3 69524 apt-transport-https_0.7.25.2_i386.deb
Checksums-Sha256: 
 44004edba97d9654afcc93d8646d726e1ae82c78c03c4fe411527dd62fc29e29 1212 apt_0.7.25.2.dsc
 f3af72df41fafebe47793c9d17b220124c781b8b47fa5ced4d2b431bc9518982 2646304 apt_0.7.25.2.tar.gz
 878c3e51e3e4060dc65fb73bdc049eec0224bc0c528d57c5120c287ac1b7937e 138688 apt-doc_0.7.25.2_all.deb
 2e057e32f8ab3b98cfa375cbe7c5cadc8bc3880f9f817ff278e18bac3d4ca405 133138 libapt-pkg-doc_0.7.25.2_all.deb
 57c421ee407bca76a4795c97b67f2f45d3568e11bbc96db321d619aef4a892e5 1749128 apt_0.7.25.2_i386.deb
 db8c1ce6850ebc399e712877800559e8ec7dbb7c6d016733cc43bc50931d3468 121454 libapt-pkg-dev_0.7.25.2_i386.deb
 59a865beea3135631a0f32070f68c61174d994431d1df0a2e874073bee2c9cbb 223736 apt-utils_0.7.25.2_i386.deb
 35e8d4f9641b77c8610524db5f300954f729975d52752ee718eb684ec35fe314 69524 apt-transport-https_0.7.25.2_i386.deb
Files: 
 aa6cb570c3de9459ed6a3af70c238402 1212 admin important apt_0.7.25.2.dsc
 1e240fd7d4503153a8d8db3f06773450 2646304 admin important apt_0.7.25.2.tar.gz
 605a43301f186f34ce84edf871770af1 138688 doc optional apt-doc_0.7.25.2_all.deb
 c9af37ba5f8c36a64647caf3ba17e633 133138 doc optional libapt-pkg-doc_0.7.25.2_all.deb
 87c4d91f33925da75712cb30cb473e92 1749128 admin important apt_0.7.25.2_i386.deb
 3465b3582136a2f203327f75bb9b0e8d 121454 libdevel optional libapt-pkg-dev_0.7.25.2_i386.deb
 4f17df3fa19c7af740f5e3b5913a16bf 223736 admin important apt-utils_0.7.25.2_i386.deb
 0ad50ab47182e4194566943d8c151c9a 69524 admin optional apt-transport-https_0.7.25.2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAktgqasACgkQliSD4VZixzRGSQCbBU3kP/cCg6bfrLwsqp2V9Jf6
S/oAni9fA85eTJevy8o/JU5t9OcLHP08
=VcjT
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: