Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902495 - app-text/texlive-2021 pdftex launched from php failed on redundant part of script
Summary: app-text/texlive-2021 pdftex launched from php failed on redundant part of sc...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: TeX project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-21 06:40 UTC by zbynek.hubinka
Modified: 2024-03-01 11:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zbynek.hubinka 2023-03-21 06:40:59 UTC
When pdftex is launched from php (i. e. by exec() or system()), crashes with error in script /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua, line 4211. There is a conditional construction to recognize OS type by questionable presence of PATH variable, especially a semicolon sign in it. PHP in default not supply the environment variables, so the function find(where, what,...) get value of nil instead of string and crashes. Older version of lua probably handled this as a warning and no error appeared. 

One solution: keeping the issue in mind and do not forget to copy the PATH variable into PHP by putenv(). This should be a problem in third-party hosted systems, because it can be considered as security option. 

Other: make a complex patch to texlive distribution, which throws out all the obviously redundant parts of the script connected with the OS detection (it is clear the system is NOT Windows). 

Another one: make a patch which just add a comment into line 4211:

local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true)

to

local onwindows=false -- os.type=="windows" or find(os.getenv("PATH"),";",1,true)

this should be satisfactory. Unfortunately I'm not very common with patching.
Comment 1 Florian Schmaus gentoo-dev 2024-03-01 10:35:16 UTC
This should be reported and fixed upstream.

@zbynek.hubinka@tul.cz would you mind making a report upstream and mention the link to the report here?
Comment 2 zbynek.hubinka 2024-03-01 11:00:37 UTC
(In reply to Florian Schmaus from comment #1)
> This should be reported and fixed upstream.
> 
> @zbynek.hubinka@tul.cz would you mind making a report upstream and mention
> the link to the report here?

OK, but I am new at bugzilla, so I do not know how.