Description

MoinMoin has XMLRPC capabilities. The XMLRPC-function putPage allows for saving pages with empty names, which causes errors e.g. with text search in MoinMoin 1.5.8.

The task is to reproduce this bug for moin 1.6 (you have to write some python xmlrpc client code for this). Fix it, provide diffs for the fix, provide your testing code.

This task is expected to need 8h of work. You have to finish it after 7 days.

Steps to reproduce

  1. srcWiki = xmlrpclib.ServerProxy('http://:@localhost/trashwiki/?action=xmlrpc2')

  2. srcWiki.putPage('', 'SomeContent')

Example

The page directory files are included in data/pages of the wiki:

[root@localhost pages]# ls -lat | head -7
total 1668
drwxr-xr-x 162 apache apache 356352 Nov  5 09:02 .
drwxr-xr-x   7 apache apache   4096 Nov  5 09:01 ..
drwxrwx---   2 apache apache   4096 Nov  5 09:01 cache
-rw-rw----   1 apache apache      9 Nov  5 09:01 current
-rw-rw----   1 apache apache     70 Nov  5 09:01 edit-log
drwxrwx---   2 apache apache   4096 Nov  5 09:01 revisions

Full text search then results in an error.

[Errno 20] Not a directory: '/var/www/trashwiki/data/pages/current/revisions/99999999'

    * args = (20, 'Not a directory')
    * errno = 20
    * filename = '/var/www/trashwiki/data/pages/current/revisions/99999999'
    * strerror = 'Not a directory'

Full traceback included.

Component selection

Details

MoinMoin Version

1.5.8

OS and Version

Linux 2.6.19-1.2288.2.4.fc5smp

Python Version

2.4.3

Server Setup

cgi-bin, mod_python

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

default

Workaround

Discussion

I've attached a patch that contains a unittest and a fix to the problem. The method now returns a xmlrpclib.Fault in case an empty pagename is supplied. The patch should also work with 1.7! moin_rpc_put_page.patch

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/XmlRpcPutPageAllowsEmptyPageName (last edited 2008-03-18 19:45:58 by JohannesBerg)