4.5.99a (mc-2002-04-26-03) .netrc patch

Thomas Zajic zlatko at gmx.at
Wed May 1 12:34:19 UTC 2002


* Thomas Zajic <zlatko at gmx.at>, 29/04/2002, 00:24

> [...] As a consequence, you'll have to explicitly add "anonymous" or
> "ftp" to the URL as a login name now if you want anonymous FTP to a
> host listed in ~/.netrc.

Ouch. As a consequence of my own stupidity, MC would try to login as
user "*netrc*" if _no_ match was found in ~/.netrc. Fixed (it will try
to login as "anonymous" now).

Patch attached, to be applied on top of the boxes.c patch and the two
previous ftpfs.[ch] patches. Should I produce One Big Patch to clean
up that mess (here's hoping that it finally works BugFree[tm] ;-)?

Bye,
Thomas
-- 
=-------------------------------------------------------------------------=
- Thomas "ZlatkO" Zajic   <zlatko at gmx.at>    Linux-2.4.18 & Mutt-1.2.5.1i -
-  "It is not easy to cut through a human head with a hacksaw."  (M. C.)  -
=-------------------------------------------------------------------------=
-------------- next part --------------
diff -ur mc-4.5.99a-orig/vfs/ftpfs.c mc-4.5.99a/vfs/ftpfs.c
--- mc-4.5.99a-orig/vfs/ftpfs.c	Wed May  1 14:17:55 2002
+++ mc-4.5.99a/vfs/ftpfs.c	Wed May  1 14:19:05 2002
@@ -1973,8 +1973,12 @@
     rupp->host = g_strdup (host);
     rupp->login = rupp->pass = 0;
     
-    if (*login != NULL)
+    if (*login != NULL) {
+    	if (!strncmp(*login, "*netrc*", 7))
+	    /* no match in ~/.netrc, try anonymous */
+	    *login = g_strdup("anonymous");
         rupp->login = g_strdup (*login);
+    }
     if (*pass != NULL)
         rupp->pass = g_strdup (*pass);
     rupp->next = rup_cache;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020501/a9b3c6d7/attachment.asc>


More information about the mc-devel mailing list