cURL / Mailing Lists / curl-users / Single Mail

curl-users

problem parsing netrc in curl

From: mel vernon <versami1_at_yahoo.com>
Date: Fri, 9 Mar 2007 14:06:00 -0800 (PST)

Hello,

I'm a new curl user, so sorry if this is too minor of
a problem to post or is too obvios to fix. I have
curl version 7.16.0 installed on HPUX 11.11. I'm
running the following curl command (all passwords and
IP's have been changed to protect the innocent):

curl -n -v --ftp-account abc123 "ftp://1.2.3.4"

the .netrc in my home directory looks like this:

machine 1.2.3.4
login "anonymous_at_ftp.somewhere.com S012345"
password anonymous
account abc123

I'm trying to attach to the server ftp.somewhere.com
through a corporate proxy server, 1.2.3.4. The login
requires the pattern "userid_at_remoteserver proxy_acct"
for the user login (anonymous_at_ftp.somewhere.com
S012345). Curl strips off the user string at the
first blank, so it is sending
anonymous_at_ftp.somewhere.com as the user, not
anonymous_at_ftp.somewhere.com S012345. This causes the
connection to the proxy server to fail.

Second problem is that I have to add the proxy account
password string to the command line (abc123). Does
curl read the account line in the .netrc, or is all
getting corrupted by the blank in the login line?
I've tried all the UNIX tricks to make the blank
invisible (quotes, backslashes, etc..)

The following works from the command line:
curl -v -u "anonymous_at_ftp.somewhere.com
S012345":anonymous --ftp-account abc123 ftp://1.2.3.4

This is OK, but I have to put the command into a shell
script, and I can't include passwords.

I'd really like this command to work, at the minimum:
curl -n ftp://1.2.3.4

I'm not using a .curlrc file, but can (if i could find
out the syntax)

Thanks In Advance!
Mike

 
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
Received on 2007-03-09