Bug 17948

Summary: IO::Socket::UNIX fails for SOCK_DGRAM sockets
Product: [Retired] Red Hat Linux Reporter: pere
Component: perlAssignee: Chip Turner <cturner>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.2CC: leonard-rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: triage|leonardjo|closed|currentrelease
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-22 15:34:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description pere 2000-09-30 12:02:23 UTC
There is a bug in /usr/lib/perl5/5.00503/i386-linux/IO/Select.pm in
the perl-5.00503-12 RPM.  It is impossible to make a SOCK_DGRAM server
using UNIX Domain Sockets.  The bug is in configure which calls listen()
for SOCK_DGRAM sockets, even if this call only works for SOCK_STREAM
and SOCK_SEQPACKET sockets.  The following patch should fix the problem.
It is already sent to the author, Graham Barr.

--- IO/Socket.pm.orig Sat Sep 30 19:12:56 2000
+++ IO/Socket.pm      Sat Sep 30 19:14:01 2000
@@ -685,8 +685,10 @@
            return undef;
     }
     if(exists $arg->{Listen}) {
-       $fh->listen($arg->{Listen} || 5) or
-           return undef;
+        if ($type == SOCK_STREAM || $type == SOCK_SEQPACKET) {
+           $fh->listen($arg->{Listen} || 5) or
+               return undef;
+        }
     }
     elsif(exists $arg->{Peer}) {
        my $addr = sockaddr_un($arg->{Peer});

With this patch I was able to get my perl implementatio of syslogd to
work.

Comment 1 Cristian Gafton 2000-10-17 23:38:42 UTC
assigned to nalin

Comment 2 Cristian Gafton 2000-10-18 16:17:11 UTC
assigned to nalin

Comment 3 Chip Turner 2002-05-13 17:59:10 UTC
is this still an issue in the latest red hat release, 7.3?

Comment 4 Petter Reinholdtsen 2002-05-13 18:12:36 UTC
I've moved to Debian since I submitted this bug report.  I do not know if it
is a problem on newer RH-versions.

I should have included test code with the bug report.  I've since changed
location, and do not have access to the problematic program anymore.


Comment 5 Leonard den Ottolander 2004-04-22 15:34:41 UTC
This code has been somewhat rearranged, but since for FC 1
/usr/lib/perl5/5.8.3/IO/Socket/UNIX.pm lines 39-46 now read

	    return undef;
    }
    if(exists $arg->{Listen} && $type != SOCK_DGRAM) {
	$sock->listen($arg->{Listen} || 5) or
	    return undef;
    }
    elsif(exists $arg->{Peer}) {
	my $addr = sockaddr_un($arg->{Peer});

it looks like the test suggested above has been implemented.

Closing CURRENTRELEASE.