Description
To reproduce:
- Start the Servlet Container JVM with
-Duser.name="vincent$"
- Create a wiki page and attach a file to it
- In the Admin UI, export this page with history/backup
- Try to reimport it with history
You'll get:
Caused by: org.suigeneris.jrcs.rcs.parse.TokenMgrError: Lexical error at line 1, column 101. Encountered: "$" (36), after : "" at org.suigeneris.jrcs.rcs.parse.ArchiveParserTokenManager.getNextToken(ArchiveParserTokenManager.java:817) at org.suigeneris.jrcs.rcs.parse.ArchiveParser.jj_ntk(ArchiveParser.java:685) at org.suigeneris.jrcs.rcs.parse.ArchiveParser.authorName(ArchiveParser.java:527) at org.suigeneris.jrcs.rcs.parse.ArchiveParser.delta(ArchiveParser.java:385) at org.suigeneris.jrcs.rcs.parse.ArchiveParser.archive(ArchiveParser.java:96) at org.suigeneris.jrcs.rcs.parse.ArchiveParser.load(ArchiveParser.java:60) at org.suigeneris.jrcs.rcs.Archive.<init>(Archive.java:259) at com.xpn.xwiki.doc.XWikiAttachmentArchive.setArchive(XWikiAttachmentArchive.java:213) at com.xpn.xwiki.doc.XWikiAttachment.setArchive(XWikiAttachment.java:967) ...
The reason is:
- JRCS uses
String author = System.getProperty("user.name");
as the default author name when not set. See Node.java
- JRCS doesn't escape it. See line 647 in Node.java (method toString())