Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 69139
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: OLIVER [...] cpan.org
Requestors: joerg.roth [...] id.uzh.ch
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem with personality => 'fwsm3'
Date: Mon, 27 Jun 2011 16:00:19 +0200
To: bug-Net-Appliance-Session [...] rt.cpan.org
From: Joerg Roth <joerg.roth [...] id.uzh.ch>
Hi Oliver, I hope everything is fine with you. I actually implementing V3 of Net::Appliance::Session and making some tests. I have problems with the "personality fwsm3" in correlation to the "privileged_paging"-parameter. ----------------- Version: Net-Appliance-Session-3.111690 OS: SLES11 SP1 Perl: v5.10.0 built for x86_64-linux-thread-multi ----------------- Sample-Script: ----------------- use Net::Appliance::Session; my $s = Net::Appliance::Session->new({ personality => 'fwsm3', transport => 'SSH', host => 'firewall', privileged_paging => 1, }); $s->set_global_log_at('debug'); $s->connect({ name => 'user', password => 'pass' }); $s->begin_privileged({password => 'enablepass'}); my $config = $s->cmd('show conn'); print "Con: $config\n"; ----------------- Wenn i comment out the privileged_paging => 1 the script works fine, but paging is not disabled as expected. ----------------- [0.539483] d SEEN: enable Password: [0.539767] t output matched (?-xism:[Pp]assword: ?$), storing and returning [0.540120] p setting new prompt to (?-xism:[Pp]assword: ?$) [0.540303] p prompt has been set to (?-xism:[Pp]assword: ?$) [0.540756] e running command enablepass [0.540966] e to match (?-xism:# ?$) [0.541366] e executing actions [0.541767] e dispatching to execute method [0.542448] t callback received for send [0.542624] t queueing data for send: "enablepass" [0.542841] t callback received for match [0.547497] d SEEN: ******** [0.547702] t nope, doesn't (yet) match (?-xism:# ?$) [0.675428] d SEEN: firewall# [0.675705] t output matched (?-xism:# ?$), storing and returning [0.675999] p setting new prompt to (?-xism:# ?$) [0.676179] p prompt has been set to (?-xism:# ?$) [0.676606] e running command show conn [0.677010] e executing actions [0.677415] e dispatching to execute method [0.678095] t callback received for send [0.678270] t queueing data for send: "show conn" [0.678484] t callback received for match [0.683411] d SEEN: show conn 62 in use, 4302 most used ..... [0.692889] t nope, doesn't (yet) match (?-xism:# ?$) [0.693113] d SEEN: <--- More --->9.132.178.180:5060 inside 192.41.134.194:5060, idle 0:01:58, bytes 3645, flags T [0.693318] t nope, doesn't (yet) match (?-xism:# ?$) ^C ----------------- Using the privileged_paging-parameter, the module sends not the enablepass to the device, but the login-password: ----------------- [0.597651] d SEEN: enable Password: [0.597941] t output matched (?-xism:[Pp]assword: ?$), storing and returning [0.598308] p setting new prompt to (?-xism:[Pp]assword: ?$) [0.598492] p prompt has been set to (?-xism:[Pp]assword: ?$) [0.598953] e running command pass [0.599164] e to match (?-xism:# ?$) [0.599565] e executing actions [0.599965] e dispatching to execute method [0.600658] t callback received for send [0.600836] t queueing data for send: "pass" [0.601053] t callback received for match [0.609603] d SEEN: ******** [0.609810] t nope, doesn't (yet) match (?-xism:# ?$) [0.857592] d SEEN: Password: [0.857871] t nope, doesn't (yet) match (?-xism:# ?$) ----------------- Kind regards and thanks for your help, Jörg -- Jörg Roth -------------------------------------------------------------------- Universitaet Zuerich http://www.id.uzh.ch Informatikdienste (ID) joerg.roth@id.uzh.ch IT-Infrastruktur / Netzwerk Tel. +41 44 6354590 Winterthurerstrasse 190 Fax. +41 44 6354505 CH-8057 Zuerich --------------------------------------------------------------------
Hi Jörg, On Tue Jun 28 13:52:54 2011, joerg.roth@id.uzh.ch wrote: Show quoted text
> I hope everything is fine with you. I actually implementing V3 of > Net::Appliance::Session and making some tests. I have problems with the > "personality fwsm3" in correlation to the "privileged_paging"-parameter.
I've taken a look and I understand why this is happening. The module always attempts to disable paging immediately after a successful connection. With privileged_paging it needs to go to privileged mode but only has the login password available, so re-uses that. As a workaround until I fix this, you can set the do_paging option to false (0), and then enter privileged mode, and then call the disable_paging method: $s->new({...., do_paging => 0}); $s->begin_privileged({password => 'foo'}); $s->disable_paging; ... then carry on with your script (maybe end_privileged if you want) $s->begin_privileged({password => 'foo'}); $s->enable_paging; $s->close; I will leave this ticket open until I have a fix. It might be that I add an additional option to connect() for the privileged password - which would also allow multiple calls to begin_privileged using the same cached password. Many thanks for letting me know about this bug, I'm very grateful. regards, oliver.