Subject: | bug and solution for GetShr |
Date: | Fri, 9 Nov 2012 11:28:11 -0500 |
To: | bug-Filesys-SmbClientParser [...] rt.cpan.org |
From: | Laurent Hubert <laurent.r.hubert [...] gmail.com> |
Hi,
Filesys-SmbClientParser support seems inactive for many years.
I experiences difficuties using some of the code
use Filesys::SmbClientParser;
my $smb = new Filesys::SmbClientParser;
my @l = $smb->GetShr;
which is taken from package documentation.
Google shows other users having similar difficulties.
DEBUG mode shows that for that particular problem the final command
executed is:
/usr/bin/smbclient "" -U "username%password" -d1-L 'hosts' -D "/"
There is two issues with this command
1- there is no space between -d1-L. It must be read instead: -d1 -L
I then add a space before "-L" a t the line 148
my $commande = "-L '\\\\$host' ";
becomes
my $commande = " -L '\\\\$host' ";
( This problem may occured only in debug mode)
2- Presence of "" in the command line of smbclient.
It should not be there. This situation may result of the difference of
numbers of parameters between GetShr and others function.
I then put a cleaning procedure in the SmOption function. (line 542)
my $args = $prefix.$command.$dir;
* $args=~ s/\"\"//g;*
return $self->command($args,$command)
;
Is there any way to include these modifications?
--
Laurent Hubert, PhD
Professionnel de recherche
Administration de systèmes Linux, déploiement de solutions Open Source
Centre d'imagerie moléculaire de Sherbrooke
Centre hospitalier universitaire de Sherbrooke
819 346 1110 x 11836
http://www.cims.med.usherbrooke.ca