cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Nick <curl-users_at_i.lucanops.net>
Date: Wed, 14 Oct 2015 20:59:41 +0100

On Wed, 14 Oct 2015 21:04:24 +0200
Dan Fandrich <dan_at_coneharvesters.com> wrote:
> > 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.
>

Thanks for that suggestion.

I've found reading in text from a file is leading to a dot
being appended to the end of the text string, the password. It would
explain the password being seen as wrong by the server.

$CURLCMD --form pwd=$NUKECODE
002c: Content-Disposition: form-data; name="pwd" ...
0058:
005a: SuperSekrit

cat keys/password | $CURLCMD --form "pwd=<-" ...
002c: Content-Disposition: form-data; name="pwd"
0058:
005a: SuperSekrit.

/hackity delay

Ahhh, looks like I've got it. It was that trailing new line all along,
when I claimed to have tested it above I must have messed that up. To
get a text string from a file it has to be just a text string.... which
really makes some sense :)

Cheers for the hint, it made me look a bit closer.

Nick
-------------------------------------------------------------------
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