jettero has asked for the wisdom of the Perl Monks concerning the following question:
This whole problem is related to the fact that I didn't copy something into my fake root ... but I haven't the foggiest idea what that would be.
Arren@Anarres II on (Intermud III) suggested it might have to do with the getpeername(). Though I didn't follow it...
[code 15:35] Arren@Anarres II: I did do a fix recently where getpeerna +me() wasn't working properly on some generated symbol globs for sockets, something seems to have changed there. Probably doesn't h +elp.
This works (without being in the chroot prison):
#!/usr/bin/perl -w use strict; use Net::SMTP; use Carp qw(confess cluck); $SIG{__WARN__} = sub { cluck(@_) }; $SIG{__DIE__} = sub { confess(@_) }; my $smtp = Net::SMTP->new("localhost", Hello=>"localhost", Timeout=>20 +, Debug=>1) or die "$!";
However, when I'm in the prison, it turns up this nonsense:
Using the perl debugger, I found this (this is not all of the trace):No such file or directory at ./file.pl line 17. main::__ANON__('No such file or directory at ./file.pl line 17 +.^J') called at ./file.pl line 17
So, I changed my Net::SMTP new to this:44: if(defined $proto) { IO::Socket::INET::_sock_info(/usr/local/lib/perl5/5.6.1/IO/Socket/INET +.pm:45): 45: if (@proto = ( $proto =~ m,\D, 46: ? getprotobyname($proto) 47: : getprotobynumber($proto)) 48: ) { IO::Socket::INET::_sock_info(/usr/local/lib/perl5/5.6.1/IO/Socket/INET +.pm:52): 52: $@ = "Bad protocol '$proto'"; IO::Socket::INET::_sock_info(/usr/local/lib/perl5/5.6.1/IO/Socket/INET +.pm:53): 53: return; IO::Socket::INET::_error(/usr/local/lib/perl5/5.6.1/IO/Socket/INET.pm: +83):
and got this:my $sock = new IO::Socket::INET ( LocalPort => 88988, Proto => 'tcp', Reuse => 1, Listen => 1, ) or die "poopy: $!";
poopy: No such file or directory at ./file.pl line 10. main::__ANON__('poopy: No such file or directory at ./file.pl +line 10.^J') called at ./file.pl line 10
Edit by tye to change 'pre' tags to 'code' tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Obscure IO::Socket poop under a chroot Help Help Help!
by jettero (Monsignor) on Jul 11, 2002 at 20:14 UTC | |
by ferrency (Deacon) on Jul 11, 2002 at 20:28 UTC |