Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 605626

Summary: net-dns/updatedd ipserv.pl script needs timeouts
Product: Gentoo Linux Reporter: Maciej S. Szmigiero <mail>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: mjo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch
patch using IO::Socket::Timeout

Description Maciej S. Szmigiero 2017-01-14 00:10:44 UTC
ipserv.pl script from net-dns/updatedd package has no explicit timeout against an
stalled TCP connection and will hang until some kernel timeout expire (which may
incur a very long wait), blocking the whole DNS host name updating process.

This is more problematic considering the package is supposed to be used in
environments where network configuration change often.

The attached patch enables keepalives on a TCP socket that ipserv.pl script
uses so a stalled connection will be terminated in about 4 minutes.
Comment 1 Maciej S. Szmigiero 2017-01-14 00:11:54 UTC
Created attachment 459934 [details, diff]
patch
Comment 2 Maciej S. Szmigiero 2017-01-14 00:12:13 UTC
We need to apply this change in Gentoo since the upstream package status is
"Orphaned/Unmaintained" (and the last release was in 2006).
Comment 3 Michael Orlitzky gentoo-dev 2017-01-14 06:37:59 UTC
I'm not an expert on this, but using keepalives seems like a roundabout way to introduce a read/write timeout. Would you be willing to try dev-perl/IO-Socket-Timeout instead? A usage example can be found here:

  https://metacpan.org/pod/IO::Socket::Timeout

(If you are still using updatedd, you might want to try to take over as maintainer and merge these fixes upstream.)
Comment 4 Maciej S. Szmigiero 2017-01-14 19:21:47 UTC
(In reply to Michael Orlitzky from comment #3)

Thanks for a very quick reaction for all 3 bugs Michael!

I have tested the package as updated by bugs 605622 and 605624 and can confirm
that everything is fine now (and revdep-rebuild does not complain which was
an issue in bug 577248).

> I'm not an expert on this, but using keepalives seems like a roundabout way
> to introduce a read/write timeout. Would you be willing to try
> dev-perl/IO-Socket-Timeout instead? A usage example can be found here:
> 
>   https://metacpan.org/pod/IO::Socket::Timeout

Thanks for pointer, that was a good idea.
I have rewritten the patch to use this module and it seems to work OK.

Naturally, dev-perl/IO-Socket-Timeout will also need to be added to this
package RDEPEND.

> (If you are still using updatedd, you might want to try to take over as
> maintainer and merge these fixes upstream.)

These 3 fixes are the only ones I have and have used (for a few years now).
But I have only an OVH account while a true maintainer would need to at least walk through all the other services and verify / fix others that have
bit-rotten in meantime, since that probably would be a biggest issue users
will have with this package.
Comment 5 Maciej S. Szmigiero 2017-01-14 19:22:36 UTC
Created attachment 460056 [details, diff]
patch using IO::Socket::Timeout
Comment 6 Michael Orlitzky gentoo-dev 2017-01-14 21:57:09 UTC
Ok, good to go, thanks. I already filed bug #605722 to have it re-keyworded on arm and ppc.

commit 5cadafb0174f267b92e5ea9e2cc90c57352e14e7
Author: Michael Orlitzky <mjo@gentoo.org>
Date:   Sat Jan 14 16:16:26 2017 -0500

    net-dns/updatedd: new revision to set timeouts for ipserv.pl.

    This new revision adds a patch by Maciej S. Szmigiero that sets
    timeouts on the socket used by ipserv.pl. Doing so prevents updatedd
    from hanging when the other end of the socket goes AWOL.

    As a consequence, dev-perl/IO-Socket-Timeout was added to RDEPEND. The
    "~arm" and "~ppc" keywords had to be dropped to satisfy that new
    dependency.

    Gentoo-Bug: 605626
    Package-Manager: portage-2.3.0
Comment 7 Maciej S. Szmigiero 2017-01-14 22:02:14 UTC
Thanks.