Account in FTP

Lorinczy Zsigmond lzsiga at mail.ahiv.hu
Fri Mar 14 15:59:38 UTC 2003


Pavel Roskin wrote:
> 
> Hello!
> 
> > My BS2000 mainframe wants account when connecting via FTP,
> > (332 Account required.) but mc do not prompts the user for it.
> > I think I could add this feature if this could be useful
> > for someone else too...
> 
> Yes, it shouldn't be too much code.  See login_server() in vfs/ftpfs.c:
> 
>       if (command (me, super, WAIT_REPLY, "PASS %s", pass) != COMPLETE)
>             break;
> 
> Add check for CONTINUE at this point and send the account.

Well I happened to hack something, could someone please check it?

Lorinczy, Zsigmond
-------------- next part --------------
--- ftpfs.bak	Thu Dec 26 03:21:43 2002
+++ ftpfs.c	Fri Mar 14 16:58:08 2003
@@ -469,7 +469,21 @@
 	switch (code){
 	case CONTINUE:
 	    print_vfs_message (_("ftpfs: sending user password"));
-            if (command (me, super, WAIT_REPLY, "PASS %s", pass) != COMPLETE)
+	    code= command (me, super, WAIT_REPLY, "PASS %s", pass);
+	    if (code==CONTINUE) {
+	        char *p;
+	    
+		p = g_strconcat (_(" FTP: Account required for "), SUP.user, 
+				  " ", NULL);
+		op = input_dialog (p, _("Account:"), "");
+		g_free (p);
+		if (op == NULL)
+			ERRNOR (EPERM, 0);
+ 	        print_vfs_message (_("ftpfs: sending user account"));
+	        code= command (me, super, WAIT_REPLY, "ACCT %s", op);
+		g_free (op);
+	    } 
+	    if (code != COMPLETE)
 		break;
 
 	case COMPLETE:


More information about the mc-devel mailing list