#170064 ncftp: File containing (machine,user,password) is not compatible with .netrc

Package:
ncftp
Source:
ncftp
Description:
User-friendly and well-featured FTP client
Submitter:
Greg Kochanski
Date:
2005-07-18 03:45:57 UTC
Severity:
normal
#170064#5
Date:
2002-11-21 17:02:42 UTC
From:
To:
Netrc is the established standard for specifying a user name and
password for outgoing FTP connections.     ncftpput uses a
different format (though very similar).

To read both formats, you could do things like
this, inside .../ncftp-3.1.5/sh_util/gpshare.c
ReadConfigFile(const char *fn, FTPCIPtr cip) :


if( fscanf(fp, "machine %s", tmp) == 1)
	strncpy(tmp, wherever, ...)
else if(fscanf(fp, "host %s", tmp) == 1)
	strncpy(tmp, wherever, ...)
else if(fscanf(fp, "user %s", tmp) == 1)
	strncpy(tmp, wherever, ...)
...
else if(fscanf(fp, "%s", tmp) == 1)
	fprintf(stderr, "Unrecognized token in %s: %s\n", filename, tmp);

#170064#10
Date:
2002-11-26 13:08:17 UTC
From:
To:
tags 170064 + upstream
forwarded 170064 ncftp@ncftp.com
thanks

I reported this problem to the upstream author.

#170064#19
Date:
2002-11-26 23:32:52 UTC
From:
To:

The .netrc file has little to do with ncftpput's config file, which can
contain exactly one set of login information.  Proper parsing of a
.netrc bloats the code without tangible benefit since you can't use it
with ncftpput without editing it.


Mike Gleason
NcFTP Software
http://www.NcFTP.com