cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Reading a file contents into a form text field, a password

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 14 Oct 2015 21:04:24 +0200

On Wed, Oct 14, 2015 at 05:06:37PM +0100, Nick wrote:
> This is pretty much what I have which works:
> CURLCMD='curl -k --connect-timeout 10 -m 24 --retry 1 --retry-delay 3'
> NUKECODE=`cat keys/password`
> $CURLCMD --form pwd=$NUKECODE --form press=submit \
> -L -c cookiejar
> 'https://host.domain.tld/fm.php' >login
>
> But variations (quotes and such) of the following do not log in, the
> server comes back that the password is wrong.
>
> $CURLCMD --form "pwd=<keys/password" --form press=submit ...
> $CURLCMD --form "pwd=@keys/password" --form press=submit ...

Using @ sends the data differently, so it's likely not the type you want.

> (I know why this one didn't work, now)
> cat keys/password|$CURLCMD --form "pwd=<-" --form
> press=submit ...
> $CURLCMD --form "pwd=<-" --form press=submit ... < keys/password
>
> Hmmm, even my final thought of trimming the final new line out the
> password file didn't help. The password itself is echo'd into the
> password file from another script, it was
> echo SuperSekrit>/path/keys/password
> changed that to
> echo -n SuperSekrit>/path/keys/password
> and the server is still responding the password is wrong.
>
> Any ideas?

Try using the --trace-ascii option in the working and non-working cases and
compare the output.

>>> Dan
-------------------------------------------------------------------
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 2015-10-14