Re: .netrc patch breaks fish, possibly mcfs and smbfs

Pavel Roskin wrote:
Hi, Thomas!

I think that vfs_split_url() needs simplification, and should not deal
with netrc, but instead should return NULL as username if the caller
promises to handle it.

I've implemented this approach beacuse it's simple and it restores the old behavior of handling all netrc stuff in ftpfs.

Unfortunately, I discovered during the testing that the proxy code is completely broken. SUP.proxy is set to 0 and is never assigned any other value. SUP.use_proxy is only used to disable passive connections.

It seems that the proxy code was broken as early as in 1999.  And you were
wondering if somebody uses netrc.

It's pretty typical for MC - you fix a small bug, test it and find another
bug during testing and so on.  That's why we should write good code from
the beginning.

Anyway, netrc support works well and all other breakage seems unrelated to
your patch.

! static void
! ftp_split_url(char *path, char **host, char **user, int *port, char **pass)
! {
!     char *p;
. . .
!     char *tmp_pass;
!     /* Caller is not interested in password, but the functions below want
!      * a valid pointer */
!     if (!pass) {
! 	pass = &tmp_pass;
!     }
. . .
Well, vfs_split_url() handles case when pass is NULL, so lines above are unnneded and
comment is incorrect.
!     p = vfs_split_url (path, host, user, port, pass, FTP_COMMAND_PORT,
! 		       URL_ALLOW_ANON);
!     if (!*user) {
! 	if (use_netrc)
! 	    lookup_netrc (*host, user, pass);
! 	else
! 	    *user = g_strdup ("anonymous");
!     }
!     if (p)
! 	g_free (p);
. . .
!     if (pass == &tmp_pass && *pass)
! 	g_free (*pass);
. . .
And these 2 lines too.
! }

Andrew V. Samoilov.

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