Displaying 5 results from an estimated 5 matches for "safefile".
2008 Jul 30
3
Dealing with image PDF's
...was just playing around and added a bit of code to omindex.cc so I
could ocr tiff and tif with gocr which seems to work. Here's what it
looks like:
// Tiff:
} else if (startswith(mimetype, "image/tif"))
{
// Inspired by http://mjr.towers.org.uk/comp/sxw2text
string safefile = shell_protect(file);
string cmd = "tifftopnm " + safefile + " | gocr -f UTF8 -";
try {
dump = stdout_to_string(cmd);
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
retur...
2008 Jul 30
3
Dealing with image PDF's
...was just playing around and added a bit of code to omindex.cc so I
could ocr tiff and tif with gocr which seems to work. Here's what it
looks like:
// Tiff:
} else if (startswith(mimetype, "image/tif"))
{
// Inspired by http://mjr.towers.org.uk/comp/sxw2text
string safefile = shell_protect(file);
string cmd = "tifftopnm " + safefile + " | gocr -f UTF8 -";
try {
dump = stdout_to_string(cmd);
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
retur...
2009 Feb 03
1
PowerPoint 2007 filter
...d commented out that also extracts notes
and comments from the powerpoint file.
// Start: PowerPoint 2007 .pptx
} else if (startswith(mimetype,
"application/vnd.openxmlformats-officedocument.presentationml."))
{
// Inspired by http://mjr.towers.org.uk/comp/sxw2text
string safefile = shell_protect(file);
/* string cmd = "unzip -p " + safefile + " ppt/slides/slide*.xml
ppt/notesSlides/notesSlide*.xml ppt/comments/comment*.xml"; */
string cmd = "unzip -p " + safefile + " ppt/slides/slide*.xml";
try {
XmlParser xmlpa...
2019 Feb 08
12
[Bug 2966] New: scp rev 1.202 fix doesn't quite hit the mark
...ssh/scp.c means to protect against a rogue
server that writes to unexpected file names, by checking that
the file name returned matches the original glob pattern.
The fix has two bugs:
1. If the requested filename contains no / characters, e.g.
scp remote:'[xyz]*' .
or even
scp remote:safefile .
no check is done; the remote is permitted to send any file name
(hence overwrite any file) it likes. The trouble is that the
new code does
if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
*restrict_pattern++ = '\0';
}
then, later,...
2019 Feb 08
12
[Bug 2966] New: scp rev 1.202 fix doesn't quite hit the mark
...ssh/scp.c means to protect against a rogue
server that writes to unexpected file names, by checking that
the file name returned matches the original glob pattern.
The fix has two bugs:
1. If the requested filename contains no / characters, e.g.
scp remote:'[xyz]*' .
or even
scp remote:safefile .
no check is done; the remote is permitted to send any file name
(hence overwrite any file) it likes. The trouble is that the
new code does
if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
*restrict_pattern++ = '\0';
}
then, later,...