Posting failure with certain content

I would report a bug but the trac site is down. I am running typo
4.0.x branch and using Markdown as the filter. Writing "ssh " in the
content or title of an article causes the preview to fail with the
following error message:

Precondition Failed
The precondition on the request for the URL
/blog/admin/content/preview evaluated to false.

Posting the failing article causes a similar failure but for
/blog/admin/content/new.

It seems to be the string "ssh " with the space. "SSH " also works.
It works on the substring so "abcssh " does it.

  • Ian

On 11/5/2006, “Ian Burrell” [email protected] wrote:

I would report a bug but the trac site is down. I am running typo
4.0.x branch and using Markdown as the filter. Writing "ssh " in the
content or title of an article causes the preview to fail with the
following error message:

I get the same error message with the Textile filter, so that’s probably
not the problem.

Precondition Failed
The precondition on the request for the URL
/blog/admin/content/preview evaluated to false.

Posting the failing article causes a similar failure but for
/blog/admin/content/new.

It seems to be the string "ssh " with the space. "SSH " also works.
It works on the substring so "abcssh " does it.

I my case a code block triggered the precondition failure. If I removed
it the post would go through. Here’s the text:

hafner@nelson:~$ cat bin/typo-clear-sessions.sh
#!/bin/sh
echo “Clear Typo session table”
/usr/local/bin/ruby /home/hafner/bettong.net/www/script/runner
‘ActiveRecord::Base.connection.delete(“DELETE FROM sessions WHERE
updated_at < now() - INTERVAL 72 HOUR”)’

Trying to reduce the amount of text needed to trigger this behaviour I
came up with almost the same as Ian. Here it’s "echo " (not the
space) that make the precondition fail.

Urban

On 11/13/2006, “Anton J Aylward” [email protected] wrote:

Urban H. wrote:

Trying to reduce the amount of text needed to trigger this behaviour I
came up with almost the same as Ian. Here it’s "echo " (not the
space) that make the precondition fail.

Have you tried other *NIX commands? who, rm, ls, test, … ?

I have now (well, just the ones you mentioned). And none of them give
the
precondition failure. Only "echo " and "ssh ". BTW, I’m running the
latest trunk.

Urban

Urban H. wrote:

Trying to reduce the amount of text needed to trigger this behaviour I
came up with almost the same as Ian. Here it’s "echo " (not the
space) that make the precondition fail.

Have you tried other *NIX commands? who, rm, ls, test, … ?


Anton J Aylward
http://emergence.antonaylward.com - Emergent Properties

Are you on textdrive?

I get the same thing. It’s mod_security .

On 11/14/2006, “Dick D.” [email protected] wrote:

Are you on textdrive?

I get the same thing. It’s mod_security .

Ah. Now that explains why I couldn’t find anything in Typo’s code. Any
way around it?

Urban

I’m 99% sure this ‘Precondition Failed’ error message is from Apache’s
mod_security and has nothing to do with Typo - it’s a module that
filters HTTP POST payloads containing whatever the host decides are
naughty bits - in this case some unix commands. I’ve experienced this
on Textdrive before. Where are you hosted, Ian? Urban?

Jesse

On 14/11/06, Urban H. [email protected] wrote:

On 11/14/2006, “Dick D.” [email protected] wrote:

Are you on textdrive?

I get the same thing. It’s mod_security .

Ah. Now that explains why I couldn’t find anything in Typo’s code. Any
way around it?

I’m using lighttpd and proxying to it.
I suspect (but haven’t tried) that if I went directly to the lighty
port,
it would bypass apache (and therefore mod_security).

Alternatively, I might just raise a ticket.

On 11/14/2006, “Urban H.” [email protected] wrote:

Ah. Now that explains why I couldn’t find anything in Typo’s code. Any
way around it?

Well, I was too fast. There’s a Knowledge Base on Textdrive just on this
topic: http://help.textdrive.com/index.php?pg=kb.page&id=85

Urban

On 14/11/06, Dick D. [email protected] wrote:

I’m using lighttpd and proxying to it.
I suspect (but haven’t tried) that if I went directly to the lighty port,
it would bypass apache (and therefore mod_security).

Just tried. It does.

On 11/14/06, jesse newland [email protected] wrote:

I’m 99% sure this ‘Precondition Failed’ error message is from Apache’s
mod_security and has nothing to do with Typo - it’s a module that
filters HTTP POST payloads containing whatever the host decides are
naughty bits - in this case some unix commands. I’ve experienced this
on Textdrive before. Where are you hosted, Ian? Urban?

Textdrive.

  • Ian

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 14, 2006, at 15:29 , Urban H. wrote:

Well, I was too fast. There’s a Knowledge Base on Textdrive just on
this
topic: http://help.textdrive.com/index.php?pg=kb.page&id=85

For those interested. I submitted a ticket and the Textdrive guys
changed mod_security so that "ssh " and "echo " now work for me.

Urban


http://bettong.net - Urban’s Blog

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFXIgdggNuVCIrEyURAu81AJsEU8r75aeOKEstDgTxg5nLoIjrbQCgiAvF
sEVv5pZlhUQM/pjIgENcj40=
=2/fv
-----END PGP SIGNATURE-----