Security Advisories (1)
CVE-2010-3438 (2019-11-12)

libpoe-component-irc-perl before v6.32 does not remove carriage returns and line feeds. This can be used to execute arbitrary IRC commands by passing an argument such as \"some text\\rQUIT\" to the 'privmsg' handler, which would cause the client to disconnect from the server.

NAME

POE::Component::IRC::Plugin::Connector - A PoCo-IRC plugin that deals with the messy business of staying connected to an IRC server.

SYNOPSIS

  use POE qw(Component::IRC Component::IRC::Plugin::Connector);

  my ($irc) = POE::Component::IRC->spawn();

  POE::Session->create( 
	package_states => [ 
		'main' => [ qw(_start lag_o_meter) ],
	],
  );

  $poe_kernel->run();
  exit 0;

  sub _start {
    my ($kernel,$heap) = @_[KERNEL,HEAP];
    $irc->yield( register => 'all' );

    $heap->{connector} = POE::Component::IRC::Plugin::Connector->new();

    $irc->plugin_add( 'Connector' => $heap->{connector} );

    $irc->yield ( connect => { Nick => 'testbot', Server => 'someserver.com' } );

    $kernel->delay( 'lag_o_meter' => 60 );
    undef;
  }

  sub lag_o_meter {
    my ($kernel,$heap) = @_[KERNEL,HEAP];
    print STDOUT "Time: " . time() . " Lag: " . $heap->{connector}->lag() . "\n";
    $kernel->delay( 'lag_o_meter' => 60 );
    undef;
  }

DESCRIPTION

POE::Component::IRC::Plugin::Connector is a POE::Component::IRC plugin that deals with making sure that your IRC bot stays connected to the IRC network of your choice. It implements the general algorithm as demonstrated at http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting.

METHODS

new

Takes one argument, 'delay', which the frequency that the plugin will ping it's server. Returns a plugin object suitable for use in POE::Component::IRC's 'plugin_add'.

$irc->plugin_add( 'Connector' => POE::Component::IRC::Plugin::Connector->new( delay => 120 ) );

lag

Returns the current 'lag' in seconds between sending PINGs to the IRC server and getting PONG responses. Probably not likely to be wholely accurate.

AUTHOR

Chris "BinGOs" Williams <chris@bingosnet.co.uk>

SEE ALSO

POE::Component::IRC POE::Component::IRC::Plugin