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

Pavel Roskin proski at gnu.org
Fri Apr 26 19:54:52 UTC 2002


Hi, Thomas!

> Enclosed you'll find a patch that enables .netrc support for mc-4.5.99a
> (the mc-2002-04-26-03 version).

Thanks for your efforts, but I cannot apply the patch is this form.  
First off, it causes a warning because lookup_netrc() is called before
being decared.  If you declare it, you still get a warning because
login_server() is called in assumption that the password won't change, and
lookup_netrc() is changing it.

I ignored the warning and tested the .netrc support.  It didn't work
correctly.  If I just enter the hostname without the username, MC should
still find the username in .netrc instead of logging in as "anonymous".  
That would be consistent with the command line ftp client.

Also it seems to me from the name of the third argument to login_server(), 
"netrcpass", that the password from .netrc should be determined earlier 
and sent to login_server().

> IIRC, .netrc support has been there since mc-4.1.x days (or at least it
> was available via ./configure), but it never quite worked for me. Today
> I finally got off my lazy ass and fixed it. :-)
> 
> Looking at the rather trivial patch, I'm wondering - am I the only one
> using .netrc these days? I can't believe nobody else has noticed this
> before. Just curious ...

First of all, it's not trivial.  I don't know if anybody noticed, but I 
didn't.

One of the reasons why it happens is because such useful features are
disabled by default.  Not everybody compiles MC from the sources and not
everybody cares to enable some features.

Either the author of the .netrc knew that it's broken and hoped to fix it
later, or he decided that it should be optional, but didn't know how to
make it optional in the user interface.

Actually, there is some disabled code for netrc configuration in boxes.c.  
I tried to fix it, but it's quite time consuming and I just don't have
time to do correctly right now.

The widget library for MC is very primitive and some indices need to be
changed when new widgets are added.  It's too easy to break the whole
dialog by adding a new checkbox in the middle.  Besides, the widgets are
listed backwards relative to their tab order.

If you want to clean it up, please do, but don't ignore warnings and test 
your patch.

-- 
Regards,
Pavel Roskin




More information about the mc-devel mailing list