cURL / Mailing Lists / curl-users / Single Mail

curl-users

command line completely broken re. arguments

From: clemens fischer <ino-news_at_spotteswoode.dnsalias.org>
Date: Thu, 05 Oct 2006 23:19:48 +0200

'uname -rms'
FreeBSD 6.2-PRERELEASE i386

'curl --version'
curl 7.15.5 (i386-portbld-freebsd6.2) libcurl/7.15.5 OpenSSL/0.9.7e zlib/1.2.2 libidn/0.6.7
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IDN IPv6 Largefile NTLM SSL libz

consider this (additional `-F' arguments deleted for brevity):

curl -F "action=flexsend" -s -A 'Lynx/2.8.5 (Compatible; ELinks)' --trace-ascii - http://www.spamcop.net/sc

  #== Info: getaddrinfo(3) failed for (Compatible;:80
  #== Info: Couldn't resolve host '(Compatible;'
  #== Info: Closing connection #0
  #== Info: getaddrinfo(3) failed for ELinks)':80
  #== Info: Couldn't resolve host 'ELinks)''
  #== Info: Closing connection #0

curl parses halfway into the option value of `-A' (user agent) and tries
to connect to the "host" after the first blank within this value, which
is completely wrong and fails.

  #== Info: About to connect() to www.spamcop.net port 80
  #== Info: Trying 212.105.197.134... == Info: connected
  #== Info: Connected to www.spamcop.net (212.105.197.134) port 80
  #=> Send header, 212 bytes (0xd4)
  #0000: POST /sc HTTP/1.1
  #0013: User-Agent: 'Lynx/2.8.5
  #002c: Host: www.spamcop.net
  #0043: Accept: */*
  #0050: Content-Length: 2563
  #0066: Expect: 100-continue
  #007c: Content-Type: multipart/form-data; boundary=--------------------
  #00bc: --------5d71db5c1ef8
  #00d2:
  #=> Send data, 2563 bytes (0xa03)
  #0000: ------------------------------5d71db5c1ef8
  #002c: Content-Disposition: form-data; name=""action"
  #005c:
  #005e: flexsend"

incorrect: the bourne shell gives a quoted value to the `-F' option.
curl leaves the leading quotes attached to the form elements name and
adds the trailing one to the form elements value, thereby invalidating
both.

apart from a much needed bug fix, is there a workaround?

regards, clemens
Received on 2006-10-06