cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: .netrc information not fully recognized

From: Jason Friedman <jason_at_powerpull.net>
Date: Tue, 23 Feb 2010 04:09:46 +0000

> At 15:01 -0700 2/22/10, Jason Friedman wrote:
>>Hi,
>>
>>spjsf_at_infodev1:~> uname -a
>>SunOS infodev1 5.10 Generic_137111-02 sun4u sparc SUNW,Sun-Fire-V890
>>
>>spjsf_at_infodev1:~> cat .netrc
>>machine den-wiki.den.ofi.com login wikiuser password myPassword
>>
>>spjsf_at_infodev1:~> curl --user wikiuser:myPassword
>>ftp://den-wiki.den.ofi.com/some_file
>>data line 1
>>
>>So, here is my problem:
>>
>>spjsf@infodev1:~> curl -v --netrc ftp://den-wiki.den.ofi.com/some_file
>>password:                                     <-- I just hit the Return key here
>>* About to connect() to den-wiki.den.ofi.com:21
>>* Connected to den-wiki.den.ofi.com (172.17.36.254) port 21
>>> USER wikiuser
>>> PASS
>>* the username and/or the password are incorrect
>>* Closing connection #0
>>curl: (10) the username and/or the password are incorrect
>>
>>Note the USER line:  curl is apparently picking my username (wikiuser)
>>from the .netrc file, but not the password.

> Have a look at DNS servers along the route.
> den-wiki.den.ofi.com  -->  66.114.124.140 on this machine but a reverse lookup fails as does 172.17.36.254. Whois fails for all three options.
>
> What's in your /etc/hosts file?
>
> I use -n all the time but everything in ~/.netrc has a dotted decimal IP address.
>
> I'm pretty sure that all versions of curl ignore permissions on .netrc but it's supposed to be r for you with everything else turned off except when you want to edit it.

These machines are on our LAN and the IP addresses are not resolvable
outside our firewall.

> you might try username:password@ftp://den-wiki.den.ofi.com/some_file.

That would probably work, but I am trying to use the login embedded in
a .netrc file and not expose it.

I should have mentioned in my original problem statement:

spjsf_at_infodev1:~> curl --version
curl 7.10.3 (sparc-sun-solaris2.10) libcurl/7.10.3 zlib/1.2.3

I should have also mentioned that this command, leveraging the .netrc
file, works from a different host with a different version of curl.

spjsf_at_dscript1:~> curl --version
curl 7.19.6 (hppa64-hp-hpux11.31) libcurl/7.19.6 OpenSSL/0.9.8k zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IPv6 Largefile NTLM SSL libz
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-23