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
srcWiki = xmlrpclib.ServerProxy('http://:@localhost/trashwiki/?action=xmlrpc2')
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
- wikirpc.putPage does not check for sanity of page name
Details
- inline:traceback.html
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
- Check for page name in client apps.
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
- Priority:
- Assigned to:
Status: fixed in 1.6 by http://hg.moinmo.in/moin/1.6/rev/68c9a7017b11, 1.7 by http://hg.moinmo.in/moin/1.7/rev/ed9b1e5cf0e1