| 1 |
[[!comment format=mdwn |
| 2 |
username="jerojasro" |
| 3 |
nickname="jerojasro" |
| 4 |
subject="RE: comment 1" |
| 5 |
date="2012-01-15T23:49:49Z" |
| 6 |
content=""" |
| 7 |
I've modified the plugin adding the possibility of indexing attachments. Only |
| 8 |
PDF attachments for now, but support for other filetypes should be real easy to add. |
| 9 |
|
| 10 |
The changes to `IkiWiki/Plugin/search.pm` are available at |
| 11 |
<http://git.devnull.li/ikiwiki.git>, in the `srchatt` branch. |
| 12 |
|
| 13 |
I have a small question about filenames and security: I'm using `qx` to execute |
| 14 |
the program that extracts the text from the PDF files, but `qx` executes a |
| 15 |
whole string, and passes it not to the program I want to run, but to a shell, |
| 16 |
so it is possible (I think) to craft a filename that, in a shell, expands to |
| 17 |
something nasty. |
| 18 |
|
| 19 |
How do the Perl/IkiWiki experts suggest to handle these potentially unsafe |
| 20 |
filenames? I've thought of the following options: |
| 21 |
|
| 22 |
* Running the text extractor program using `Proc::Safe`. I could not find a |
| 23 |
Debian package for it, and I'd rather avoid adding another dependency to |
| 24 |
IkiWiki. |
| 25 |
* Running the text extractor program as suggested in the `perlipc` document, |
| 26 |
using `fork` + `exec`. |
| 27 |
|
| 28 |
I haven't done any of those because I'd like to check if there are any helpers |
| 29 |
in IkiWiki to do this. Perhaps the `IkiWiki::possibly_foolish_untaint` function |
| 30 |
does it? (I didn't really understand what it does...) |
| 31 |
"""]] |