[darcs-devel] [issue1220] wiki: can't login with curl

Trent Buck bugs at darcs.net
Tue Nov 11 05:00:37 UTC 2008


New submission from Trent Buck <trentbuck at gmail.com>:

It appears that wiki.darcs.net currently does not allow anonymous
edits:

    $ editmoin http://wiki.darcs.net/index.html/TrentBuck
    You are not allowed to edit this page.
    error: body information not found

Therefore, I have created an account using w3m.  Instead of giving
editmoin my username and password and having *it* perform the login
step, I apparently have to give it a session cookie.

Therefore, I am attempting to log in with curl so as to generate a
session cookie.  Apart from the fact that I don't know how to extract
session cookies from w3m, this is useful because cookies expire daily
(which I approve of), and therefore I will need to re-create this
session cookie each time I use editmoin.

Where my password is stored (without a trailing newline) in
~/.darcs-wiki.secret,

    $ u=http://wiki.darcs.net/index.html/UserPreferences
    $ f=~/.darcs-wiki.secret
    $ curl $u -F name=TrentBuck -F password=@$f
    You are not allowed to access this!

It appears that wiki.darcs.net has blacklisted curl users.  Therefore,
I spoof User-Agent accordingly:

    $ a='W3C standards are important. Stop fucking obsessing over user-agent already.'
    $ curl $u -A "$a" -F name=TrentBuck -F password=@$f

This results in an HTML page that is *not* logged in.  You can render
it thusly:

    $ curl -s $u -A "$a" -F name=TrentBuck -F password=@$f |
    > w3m -dump -T text/html

----------
messages: 6649
nosy: dagit, dmitry.kurochkin, kowey, simon, thorkilnaur, twb
status: unread
title: wiki: can't login with curl

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1220>
__________________________________


More information about the darcs-devel mailing list