On 22.07.2016 20:23, Jeff Breidenbach wrote:

> No, I'm not sure. Leptonica is big and requires a thorough review in 
> conjunction with upstream. Thank you for helping identify
> convertTiffMultipageToPS(), and please report anything else you
> happen to notice on mainline paths. Highly appreciated.

Leptonica IMHO suffers from two different problems WRT /tmp paths:

a) genTempFilename()
which you worked around already.

b) hard-coded constants.
I just did
 rgrep ' = "/tmp'
which finds several places in progs/ and src/ where a predictable path
is pre-defined instead of being generated randomly at runtime:

src/utils.c:        if (tmpdir == NULL) tmpdir = "/tmp";
src/utils.c:    char pattern[] = "/tmp/lept.XXXXXX";
src/xtractprotos.c:static const char *tempfile = "/tmp/temp_cpp_output.txt";
src/psio2.c:const char   tempdefault[] = "/tmp/junk_temp_g4.tif";
src/psio1.c:const char   tnameb[] = "/tmp/lept/psio/mixed.tif";
src/psio1.c:const char   tnamec[] = "/tmp/lept/psio/mixed.jpg";
src/psio1.c:const char  nametif[] = "/tmp/junk_convert_ps_embed.tif";
src/psio1.c:const char  namejpg[] = "/tmp/junk_convert_ps_embed.jpg";
prog/xtractprotos.c:static const char *tempfile =
"/tmp/temp_cpp_output.txt";
prog/splitimage2pdf.c:const char  *psfile = "/tmp/junk_split_image.ps";
prog/mtifftest.c:static const char *weasel_rev = "/tmp/tiff/weasel_rev";
prog/mtifftest.c:static const char *weasel_rev_rev =
"/tmp/tiff/weasel_rev_rev";
prog/mtifftest.c:static const char *weasel_orig = "/tmp/tiff/weasel_orig";
prog/fpixcontours.c:static const char *fileout = "/tmp/fpixcontours.png";

I guess there will be more, because the simple grep I did is quite
primitive, but it is a start.

Grüße,
Sven




Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to