Re: [lftp] lftp 4.6.1 - issue with close command

2015-01-29 Thread System Administrator
Thank you, this works

close  open 


May I suggest as a future enhancement to add an option to the close
command to actually do a disconnect, ie invalidate the last open ?
Regards.

On 1/29/2015 12:41 AM, Alexander V. Lukyanov wrote:
 On Wed, Jan 28, 2015 at 02:52:48PM -0600, System Administrator wrote:
 I'm having an issue understanding the effect of the command *close*, as
 it seems different than a disconnect.

 With lftp 4.6.1:

 open -u username,password -p 22 sftp://hostname/
 ls   - returns a listing
 close
 ls   - still connects and returns the listing ! I expected this to fail.
 It's correct behaviour. close command closes connections to the server,
 but the server is still selected for communication. To undo an open command,
 use:
   open 


___
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp


Re: [lftp] lftp 4.6.1 - issue with close command

2015-01-28 Thread System Administrator
I am using SFTP (SSH)
Per a suggestion on the list, I tried the following, but same behavior:

set ftp:web-mode true
open -u username,password -p 22 sftp://hostname/
put /tmp/test.bin   - works
close
put /tmp/test.bin   - still connects and upload a file

Certainly an unwanted behavior in the environment I'm working in.
Imagine the following scenario:

open -u username1,password1 -p 22 sftp://site1/   - works
mput /tmp/site1.*   - works
close

open -u username2,password2 -p 22 sftp://site2/  - fails
mput /tmp/site2.*   - since the lat open failed, still connects to site
1 and upload a file, hence high risk.

Interested on how to resolve this, ie how to safely open and close
multiple connections in the same lftp script.
Thanks !



On 1/28/2015 3:09 PM, Szépe Viktor wrote:
 Maybe this helps you

 ftp:web-mode (boolean)
   disconnect  after  closing  data connection. This can be
 useful for totally broken ftp
   servers. Default is *false*

 http://lftp.yar.ru/lftp-man.html



 Idézem/Quoting System Administrator t...@criticalsys.net:

 Hi,

 I'm having an issue understanding the effect of the command *close*, as
 it seems different than a disconnect.

 With lftp 4.6.1:

 open -u username,password -p 22 sftp://hostname/
 ls   - returns a listing
 close
 ls   - still connects and returns the listing ! I expected this to
 fail.

 Could we have an option (-k) to close that would actually disconnect
 from the connection open previously, this to allow subsequent open
 commands with no risks.

 Please let me know if I missed something obvious.
 Best regards.
 ___
 lftp mailing list
 lftp@uniyar.ac.ru
 http://univ.uniyar.ac.ru/mailman/listinfo/lftp


 Szépe Viktor

___
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp


Re: [lftp] lftp 4.6.1 - issue with close command

2015-01-28 Thread Alexander V. Lukyanov
On Wed, Jan 28, 2015 at 04:28:10PM -0600, System Administrator wrote:
 Imagine the following scenario:
 
 open -u username1,password1 -p 22 sftp://site1/   - works
 mput /tmp/site1.*   - works
 close
 
 open -u username2,password2 -p 22 sftp://site2/  - fails
 mput /tmp/site2.*   - since the lat open failed, still connects to site
 1 and upload a file, hence high risk.

You can use one on these:

set cmd:fail-exit yes
or
open ... || exit

-- 
   Alexander.
___
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp