Skip Menu |
Report information
Id: 3086
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: brianr [at] ssprdmh01.liffe.com
Cc:
AdminCc:

Operating System: Solaris
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.6.0
Fixed In: (no value)



Date: Wed, 12 Apr 2000 16:03:03 +0100 (BST)
From: Brian Raven - Equity Options <brianr [...] ssprdmh01.liffe.com>
To: perlbug [...] perl.com
Subject: Behaviour change in IO::Socket::INET
Download (untitled) / with headers
text/plain 4.4k
This is a bug report for perl from brianr@liffe.com, generated with the help of perlbug 1.28 running under perl v5.6.0. ----------------------------------------------------------------- The behaviour of _sock_info (in IO::Socket::INET.pm) has changed so that the call will fail if getservbyname fails, even if a valid port number has been supplied, e.g "pop3(110)". I suggest the following patch: *** INET.pm.orig Tue Apr 11 14:56:53 2000 --- INET.pm Wed Apr 12 15:30:53 2000 *************** *** 34,39 **** --- 34,40 ---- sub _sock_info { my($addr,$port,$proto) = @_; + my $origport = $port; my @proto = (); my @serv = (); *************** *** 59,72 **** my $defport = $1 || undef; my $pnum = ($port =~ m,^(\d+)$,)[0]; ! if ($port =~ m,\D,) { ! unless (@serv = getservbyname($port, $proto[0] || "")) { ! $@ = "Bad service '$port'"; ! return; ! } ! } $port = $pnum || $serv[2] || $defport || undef; $proto = (getprotobyname($serv[3]))[2] || undef if @serv && !$proto; --- 60,73 ---- my $defport = $1 || undef; my $pnum = ($port =~ m,^(\d+)$,)[0]; ! @serv = getservbyname($port, $proto[0] || "") ! if ($port =~ m,\D,); $port = $pnum || $serv[2] || $defport || undef; + unless (defined $port) { + $@ = "Bad service '$origport'"; + return; + } $proto = (getprotobyname($serv[3]))[2] || undef if @serv && !$proto; [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=medium --- Site configuration information for perl v5.6.0: Configured by cobuild at Mon Mar 27 17:16:22 BST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris uname='sunos jessie 5.6 generic_105181-17 sun4u sparc sunw,ultra-2 ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-I/usr/local/include' ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib -L/opt/SUNWspro/SC4.2/lib ' libpth=/usr/local/lib /opt/SUNWspro/SC4.2/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/opt/SUNWspro/SC4.2/lib' Locally applied patches: --- @INC for perl v5.6.0: /connectproducts/local/perl/lib/5.6.0/sun4-solaris /connectproducts/local/perl/lib/5.6.0 /connectproducts/local/perl/lib/site_perl/5.6.0/sun4-solaris /connectproducts/local/perl/lib/site_perl/5.6.0 /connectproducts/local/perl/lib/site_perl . --- Environment for perl v5.6.0: HOME=/home/ssdevws54/brianr LANG=en_UK LANGUAGE (unset) LC_COLLATE=en_UK LC_CTYPE=en_UK LC_MESSAGES=C LC_MONETARY=en_UK LC_NUMERIC=en_UK LC_TIME=en_UK LD_LIBRARY_PATH=/home/ssdevws54/brianr/opt/lib::/home/ssdevws54/brianr/connect/ACE/ace:/home/ssdevws54/brianr/connect/common/lib:/home/ssdevws54/brianr/connect/host/lib:/home/ssdevws54/brianr/connect/gateway/lib:/home/ssdevws54/brianr/connect/api/lib:/extra/lifcommon/v6_4/object/SunOS5.6 LOGDIR (unset) PATH=/products/purify:/connectproducts/local/perl/bin:/connectproducts/local/netscape:/connectproducts/local/bin:/home/ssdevws54/brianr/opt/bin:/home/ssdevws54/brianr/connect/bin:/products/SNIFF32/bin:/home/ssdevws54/brianr/bin:.:/bin:/usr/bin:/usr/sbin:/usr/local/bin::/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/home/ssdevws54/brianr/connect/host/bin:/products/mkssi/sol2:/usr/dt/bin:/home/ssdevws54/brianr/../LDAP/1.0.17/bin:/products/python/Python-1.5.1/bin:/usr/ucb PERL_BADLANG (unset) SHELL=/usr/bin/ksh
This patch appears to have been applied Apr 2000.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org