[Samba] SMBCLIENT and PERL

William R. Knox wknox at mitre.org
Fri Feb 8 07:59:26 GMT 2002


Well, the difference could well be that you are using single quotes, which
prevents interpretation of the % as a hash variable (i.e. in Brian's
version, %testpass is being interpreted as a hash), so Brian's would work
if he changed

open(SMBCLIENT,"|/usr/bin/smbclient //thor/w-drive -U testuser%testpass");

to

open(SMBCLIENT,'|/usr/bin/smbclient //thor/w-drive -U testuser%testpass');

Good luck.

			Bill Knox
			Senior Operating Systems Programmer/Analyst
			The MITRE Corporation

On Thu, 7 Feb 2002, Joel Hammer wrote:

> Date: Thu, 7 Feb 2002 19:58:30 -0500
> From: Joel Hammer <Joel at HammersHome.com>
> To: Brian <batman at thundermail.com>, samba at lists.samba.org
> Subject: Re: [Samba] SMBCLIENT and PERL
>
> Well, your first script works on my machine, although I changed it to:
> print `smbclient //thor/w-drive -Uuser%pass -c "cd temp;lcd /home/test;put testfile.txt testfile.txt"`
>                                  ^^^^^^^^^^
> So, you are doing something wrong.
> Joel
>
>
> On Thu, Feb 07, 2002 at 04:00:51PM -0800, Brian wrote:
> > That would be a good idea heh.
> > Actually I have tried two methods:
> > #!/usr/bin/perl
> > print `smbclient //thor/w-drive -A credentials -c "cd temp;lcd
> > /home/test;put
> > testfile.txt testfile.txt"`
> >
> > OR:
> > #!/usr/bin/perl
> > open(SMBCLIENT,"|/usr/bin/smbclient //thor/w-drive -U testuser%testpass");
> > sleep(5);
> > print SMBCLIENT("cd imail");
> > print SMBCLIENT("lcd /home/test");
> > print SMBCLIENT("put testfile.txt");
> > sleep(20);
> > close(SMBCLIENT);
> >
> >
> > Neither one seems to authenticate as testuser
> >
> > Brian Andrus
> >
> > ----- Original Message -----
> > From: "Joel Hammer" <Joel at HammersHome.com>
> > To: "Brian" <batman at thundermail.com>; <samba at lists.samba.org>
> > Sent: Thursday, February 07, 2002 8:16 AM
> > Subject: Re: [Samba] SMBCLIENT and PERL
> >
> >
> > > Why not include your PERL script? There may be a clue in it.
> > > Joel
> > >
> > > --
> > > To unsubscribe from this list go to the following URL and read the
> > > instructions:  http://lists.samba.org/mailman/listinfo/samba
> > >
> >
> >
> > --
> > To unsubscribe from this list go to the following URL and read the
> > instructions:  http://lists.samba.org/mailman/listinfo/samba
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
>






More information about the samba mailing list