[Patch] FISH freezes MC on abort of transfer



There is a little bug in FISH vfs -- file transfer abortion is not working properly.

 How to reproduce:
1. Login as unprivileged user, invoke MC
2. Set on one panel any local directory where you have no write access
3. On the other panel, cd somewhere using FISH  (cd /#sh: ... )
4. Try to copy some file from remote system to local dir.
5. Because of missing write access, MC report error and then starts to abort transfer. But never finishes it...

The issue is inspired by the trivial bug -- see the patch attached. Instead of flush of the same amount of bytes as the non-transferred file is, everything is flushed, including special FISH`s exit codes...

--
		Dmitry K. Butskoj <dmitry butskoj name>
		Saint-Petersburg, Russia
		Red Hat Certified Engineer 809003662809495

diff -Nrbu mc-4.6.1-20041108/vfs/fish.c mc-4.6.1-20041108-OK/vfs/fish.c
--- mc-4.6.1-20041108/vfs/fish.c	2004-11-25 15:56:59.000000000 +0300
+++ mc-4.6.1-20041108-OK/vfs/fish.c	2004-11-25 15:45:35.000000000 +0300
@@ -623,9 +623,11 @@
     print_vfs_message( _("Aborting transfer...") );
     do {
 	n = MIN(8192, fh->u.fish.total - fh->u.fish.got);
-	if (n)
+	if (n) {
 	    if ((n = read(SUP.sockr, buffer, n)) < 0)
 	        return;
+	    fh->u.fish.got += n;
+	}
     } while (n);
 
     if (fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]