On Mon, Dec 12, 2011 at 11:25:01AM -0500, Jon Daley wrote:
> Package: apt-cacher
> Version: 1.7.2
> Severity: normal
> Tags: patch
> 
> I've been running apt-cacher with xinetd, and made my own 
> /etc/xinetd.d/apt-cacher:
> service apt-cacher
> {
>         disable         = no
>         type            = UNLISTED
>         socket_type     = stream
>         protocol        = tcp
>         user            = www-data
>         wait            = no
>     server      = /usr/sbin/apt-cacher
>     server_args = -i
>     bind        = clementine.internal
>     port        = 3142
> }                                                                             
>   
> 
> And it has been working fine, but I was having trouble connecting today, and 
> looked in the log, and saw these messages:
> Use of uninitialized value $xinetdconf in concatenation (.) or string at 
> /usr/sbin/apt-cacher line 1995.
> Warning: no apt-cacher port found in 
> 
> which it turns out have been occurring for as long as I've had it in xinetd 
> mode.  They come from around line 2010.
> 
> Here is my fix.  I'm not sure what the original for loop was trying to do, 
> but it appears to not have worked.  From the docs, I 
> would have guessed a foreach was more appropriate, but the change below fixes 
> it.  The original code doesn't search the xinetd.d directory at all.

Thanks for this, but I am afraid I don't quite understand what is going 
on.

I can see the uninitialized value warning, but I can't see how it is 
arising. :(

For and foreach loops in perl are identical, as far as I know....

I think the fix for globbing /etc/xinetd.d/* correctly is below. Could 
you test it for me please.

Many thanks

Mark

diff --git a/apt-cacher b/apt-cacher
index c9042a6..dccb22e 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -1986,7 +1986,7 @@ sub get_inetd_port {
        my $ident;
        my $found;
       FILE:
-       for ($xinetdconf, glob('$xinetdconfdir/*')) {
+       for ($xinetdconf, glob("$xinetdconfdir/*")) {
            open(my $fh, '<', $_) || do {
                info_message("Warning: Cannot open $_, $!"); next;
            };



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to