Bug 17948 - IO::Socket::UNIX fails for SOCK_DGRAM sockets
IO::Socket::UNIX fails for SOCK_DGRAM sockets
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Chip Turner
triage|leonardjo|closed|currentrelease
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-30 08:02 EDT by pere
Modified: 2007-04-18 12:28 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 11:34:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description pere 2000-09-30 08:02:23 EDT
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 19:38:42 EDT
assigned to nalin
Comment 2 Cristian Gafton 2000-10-18 12:17:11 EDT
assigned to nalin
Comment 3 Chip Turner 2002-05-13 13:59:10 EDT
is this still an issue in the latest red hat release, 7.3?
Comment 4 Petter Reinholdtsen 2002-05-13 14:12:36 EDT
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 11:34:41 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.