Mangled file names in temp dir

Enrico Forestieri forenr at lyx.org
Mon Oct 23 21:30:44 UTC 2023


On Mon, Oct 23, 2023 at 05:25:53PM +0200, Pavel Sanda wrote:
> 
>On Mon, Oct 16, 2023 at 07:58:00PM +0200, Enrico Forestieri wrote:
>> On Mon, Oct 16, 2023 at 03:41:59PM +0200, Pavel Sanda wrote:
>> >
>> >On Sun, Oct 15, 2023 at 09:07:24PM +0200, Enrico Forestieri wrote:
>> >>Pavel, in commit eef0c8e8 you say:
>> >>
>> >>>xHTML export: change filenames of exported images.
>> >>>
>> >>>This patch aims at:
>> >>>1. replacing absolute paths by their hashes (do not leak directory structures)
>> >>>2. not using counters anymore so that changing figures order in the document
>> >>>   does not lead to large number of obsolete images in export directory.
>> >>>
>> >>>Other changes than in xHTML export of images are unintended.
>> >>
>> >>I think that there are unintented changes because now the mangled names of
>> >>graphics in the temporary dir do not contain the mangled path and thus it is
>> >>difficult/impossible to tell from where they are coming.
>> >
>> >I'll try to fix that in the next days, as this should not appear for latex export.
>> >But you are OK with having it obfuscated in temp directory when xHTML output is used, right?
>>
>> Sure.
>
>This patch should salvage the situation (I separated the tables for xhtml() and
>latex() routes).

Thank you, it works for me.

>There is one point I'm not sure about - is it really true that windows still
>set default limit for max path length to ~260 chars?

Yes, the APIs are still limited to that length:

$ grep MAX_PATH /usr/include/w32api/minwindef.h
#define MAX_PATH 260

even if the kernel can deal with 32K paths when they are specially 
prefixed. Starting with Windows 10 longer paths can be used but that is 
an opt-in feature. See:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

>If so it might be good use shorter hash for windows. I previously used sha-256
>resulting in +65 chars, but we could swicth to sha-1 (41 chars) or turn it off
>altogether for windows. Any opinion about that?

I suggest to simply using a counter also in the html export case and 
forget about encrypted paths. I mean, simply use a progressive number 
and name of file.

-- 
Enrico


More information about the lyx-devel mailing list