I am trying to execute a command to copy a file from my Linux box to my Windows 2K box in a perl script. My problem is that when I use the command: smbclient //thor/w-drive -A credentials -c "cd temp;lcd /home/test;put testfile.txt testfile.txt" from either a shell script or command line, it works, but in a perl script, I get: added interface ip=10.1.1.11 bcast=10.1.1.255 nmask=255.255.255.0 added interface ip=124.12.6.40 bcast=124.12.6.255 nmask=255.255.255.0 session setup failed: ERRDOS - ERRnoaccess (Access denied.) Try as I might (using -U instead of -A, using env variables of PASSWD, etc) I can NOT get that file to copy from a perl script. I always get the Access denied error. From what I have been seeing, when run from perl, it looks like it wants to connect anonymously no matter what parameters I set. Any ideas? Brian Andrus
My money is on your perl script - sounds like you are not getting the parameters you THINK you are getting to the system or whatever other method you are using in perl to execute this command. Don -----Original Message----- From: Brian [mailto:batman@thundermail.com] Sent: Thursday, February 07, 2002 10:45 AM To: samba@lists.samba.org Subject: [Samba] SMBCLIENT and PERL I am trying to execute a command to copy a file from my Linux box to my Windows 2K box in a perl script. My problem is that when I use the command: smbclient //thor/w-drive -A credentials -c "cd temp;lcd /home/test;put testfile.txt testfile.txt" from either a shell script or command line, it works, but in a perl script, I get: added interface ip=10.1.1.11 bcast=10.1.1.255 nmask=255.255.255.0 added interface ip=124.12.6.40 bcast=124.12.6.255 nmask=255.255.255.0 session setup failed: ERRDOS - ERRnoaccess (Access denied.) Try as I might (using -U instead of -A, using env variables of PASSWD, etc) I can NOT get that file to copy from a perl script. I always get the Access denied error. From what I have been seeing, when run from perl, it looks like it wants to connect anonymously no matter what parameters I set. Any ideas? Brian Andrus -- To unsubscribe from this list go to the following URL and read the instructions: lists.samba.org/mailman/listinfo/samba
What is the syntax you are using on the perl call? On Thu, 2002-02-07 at 09:50, MCCALL,DON (HP-USA,ex1) wrote:> > My money is on your perl script - sounds like you are not getting the > parameters you THINK you are getting to the system or whatever other > method you are using in perl to execute this command. > Don > -----Original Message----- > From: Brian [mailto:batman@thundermail.com] > Sent: Thursday, February 07, 2002 10:45 AM > To: samba@lists.samba.org > Subject: [Samba] SMBCLIENT and PERL > > > I am trying to execute a command to copy a file from my Linux box to my > Windows 2K box in a perl script. > > My problem is that when I use the command: > > smbclient //thor/w-drive -A credentials -c "cd temp;lcd /home/test;put > testfile.txt testfile.txt" > > from either a shell script or command line, it works, but in a perl script, > I get: > > added interface ip=10.1.1.11 bcast=10.1.1.255 nmask=255.255.255.0 > added interface ip=124.12.6.40 bcast=124.12.6.255 nmask=255.255.255.0 > session setup failed: ERRDOS - ERRnoaccess (Access denied.) > > Try as I might (using -U instead of -A, using env variables of PASSWD, etc) > I can NOT get that file to copy from a perl script. I always get the Access > denied error. From what I have been seeing, when run from perl, it looks > like it wants to connect anonymously no matter what parameters I set. > > Any ideas? > > Brian Andrus > > > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: lists.samba.org/mailman/listinfo/samba > > -- > To unsubscribe from this list go to the following URL and read the > instructions: lists.samba.org/mailman/listinfo/samba-- Chris D. Garringer LAN/WAN Supervisor Toshiba International 713-466-0277 x3756 fax 713-896-5266 Red Hat Certified Engineer Novell MCNE Certified Solaris Administrator
Why not include your PERL script? There may be a clue in it. Joel
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@HammersHome.com> To: "Brian" <batman@thundermail.com>; <samba@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: lists.samba.org/mailman/listinfo/samba >
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@HammersHome.com> > To: "Brian" <batman@thundermail.com>; <samba@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: lists.samba.org/mailman/listinfo/samba > > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: lists.samba.org/mailman/listinfo/samba