Description

The include macro does not check, if the to-be-included page exists. As a result a new directory is made in data/pages.

In combination with virtual pages this blast the filesystem on gauss.ffii.org

Steps to reproduce

Use the Include Macro on a non existing page. Check data/pages before and afterwards.

Example

Google Cache: http://66.102.9.104/search?q=cache:DB1dQn-Db64J:gauss.ffii.org/PatentView/EP775424

##Example wiki markup that fail
[[Include(PageWitchDoesNotExist)]]

Details

MoinMoin Version

1.3.2

OS and Version

Debian Sarge

Python Version

2.3.4

Server Setup

twisted

Server Details

Workaround

Regularly delete unused directories in data/pages

Patch

--- /home/wiki/dev/moin-1.3.2/MoinMoin/macro/Include.py 2005-01-16 11:20:26.000000000 +0100
+++ Include.py  2005-02-24 17:27:03.000000000 +0100
@@ -107,6 +107,8 @@
         fmt = macro.formatter.__class__(request, is_included=True)
         fmt._base_depth = macro.formatter._base_depth
         inc_page = Page(request, inc_name, formatter=fmt)
+        if not inc_page.exists():
+            continue
         inc_page._macroInclude_pagelist = this_page._macroInclude_pagelist
 
         # check for "from" and "to" arguments (allowing partial includes)

Discussion

The patch may solve this case, but the real problem is creating new directories for pages that do not exists yet. This may be solved only in 1.4.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/IncludeMacroChecksIfPageExists (last edited 2007-10-29 19:19:04 by localhost)