Your message dated Thu, 13 Oct 2005 22:56:26 -0400
with message-id <[EMAIL PROTECTED]>
and subject line Done
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Jul 2005 01:21:55 +0000
>From [EMAIL PROTECTED] Tue Jul 12 18:21:55 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.gmx.de (mail.gmx.net) [213.165.64.20] 
        by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
        id 1DsVwg-0004hP-00; Tue, 12 Jul 2005 18:21:54 -0700
Received: (qmail 31371 invoked by uid 0); 13 Jul 2005 01:21:23 -0000
Received: from 201.252.143.102 by www39.gmx.net with HTTP;
        Wed, 13 Jul 2005 03:21:23 +0200 (MEST)
Date: Wed, 13 Jul 2005 03:21:23 +0200 (MEST)
From: "Ramiro Morales" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
MIME-Version: 1.0
Subject: =?ISO-8859-1?Q?apt-cacher_isn't_compatible_with_perl_<_5.8_anymore?=
X-Priority: 3 (Normal)
X-Authenticated: #13116010
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: WWW-Mail 1.6 (Global Message Exchange)
X-Flags: 0001
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: apt-cacher
Version: 0.9.9

The package dependency list has a

  Depends: perl (>= 5.6.0-16)

line but the open() form used to execute curl in apt-cacher.pl 
is present on versions of Perl since version 5.8. See
"Using open() for IPC" - "Safe Pipe Opens" section of perlipc(1)

As I understand it (with my very basic Perl knowlegde)
the combination of a 3-parameter open() call and
a second parameter value of "-|" isn't valid on perl < 5.8.

I found this trying to backport (not really, it´s only a 
matter of apt-get source ...; dpkg-buildpackage ...) the 
current Sid apt-cacher (0.9.9) and Sarge (0.9.4) packages 
to Woody (perl 5.6.1). A basic test program I made trying
to isolate the problem gives:

Can't use an undefined value as filehandle reference at ./test.pl line 80.

pointng to the 

  open($getpipe, "-|", @elist);

line (test.pl:80 is equivalent to apt-cacher.pl:768).

The end user symptom is that on Woody the child apt-cacher
doesn´t get any data from curl when a client system connects
to the apt-cacher central cache, with debug set to 1 on
/etc/apt-cacher/apt-cacher.conf, /var/log/apt-cacher/error.log
shows:

Tue Jul 12 14:30:19 2005|172.17.2.2|debug: fetcher: try to pick up
http://security.debian.org/dists/sarge/updates/main/binary-i386/Packages.gz
Tue Jul 12 14:30:19 2005|172.17.2.2|debug: Executing /usr/bin/curl -D-
--stderr /dev/null
http://security.debian.org/dists/sarge/updates/main/binary-i386/Packages.gz
Tue Jul 12 14:30:21 2005|172.17.2.2|debug: no header yet...
Tue Jul 12 14:30:21 2005|172.17.2.2|debug: read 0 bytes
Tue Jul 12 14:30:23 2005|172.17.2.2|debug: no header yet...
Tue Jul 12 14:30:23 2005|172.17.2.2|debug: read 0 bytes
Tue Jul 12 14:30:25 2005|172.17.2.2|debug: no header yet...
...

The solution is trivial if you update the above Depends line
just for correctness (because the problem never will occur
on Sarge or later releases of Debian).

Alternatively you may wish to consider the patch below
(I  managed to assemble it by copying sample code from the 
relevant perlipc(1) manpage section) to make it compatible 
with older perls ... and making us users of Woody systems happy :-).

If so please review the following because I´m not fond on them:

* The $mypid variable scope
* The fact I only put the while(<$getpipe>) loop 
  inside the parent code path
* The
    ($EUID, $EGID) = ($UID, $GID); # suid only
  line
* The
    exec(@elist) || die "can't exec program: $!";
  line

--- apt-cacher.pl-dist  Tue Jul 12 21:19:04 2005
+++ apt-cacher.pl       Tue Jul 12 21:35:18 2005
@@ -765,19 +765,25 @@
   # Run the command we've built up
   my ($data, $getpipe, $chfd);
   open($chfd, ">$cached_head");
-  open($getpipe, "-|", @elist);
-  while(<$getpipe>) {
-     if($data) {
+  my $mypid = open($getpipe, "-|");
+  if ($mypid) { # parent
+    while(<$getpipe>) {
+      if($data) {
         data_feed(\$_) if !$do_import; # checksum passed data if not an
meta file
         print CF $_;
-        next ;
-     }
-     s/\r//;
-     print $chfd $_;
-     if(/^$/) {
+       next ;
+      }
+      s/\r//;
+      print $chfd $_;
+      if(/^$/) {
         close($chfd);
         $data=1;
-     }
+      }
+    }
+  } else { # child
+    ($EUID, $EGID) = ($UID, $GID); # suid only
+    exec(@elist) || die "can't exec program: $!";
+    # NOTREACHED
   }
   close($getpipe);
   my $rc=($?>>8);


Regards,

--
 Ramiro

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

---------------------------------------
Received: (at 318035-close) by bugs.debian.org; 14 Oct 2005 02:54:09 +0000
>From [EMAIL PROTECTED] Thu Oct 13 19:54:08 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.vif.com (buddha.vif.com) [216.239.64.153] 
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1EQFhw-00048E-00; Thu, 13 Oct 2005 19:54:08 -0700
Received: from [216.239.76.74] (ip216-239-76-74.vif.net [216.239.76.74])
        by buddha.vif.com (8.13.1/8.13.1) with ESMTP id j9E2s4uh086407
        for <[EMAIL PROTECTED]>; Thu, 13 Oct 2005 22:54:04 -0400 (EDT)
        (envelope-from [EMAIL PROTECTED])
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 13 Oct 2005 22:56:26 -0400
From: Filipus Klutiero <[EMAIL PROTECTED]>
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050817)
X-Accept-Language: fr, en
MIME-Version: 1.0
To: [EMAIL PROTECTED]
Subject: Done
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-vif-MailScanner-Information: Please contact the ISP for more information
X-vif-MailScanner: Found to be clean
X-vif-MailScanner-From: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-2.0 required=4.0 tests=BAYES_00,ONEWORD autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02

Version: 1.0.1

Eduard, I take it that you didn't know about BTS version tracking when 
you tagged this sarge, and won't actually get this fixed in sarge, so 
I'll untag this sarge.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to