Bug in TL 2024? Cannot create file in upper directory.

khzimmer at posteo.de khzimmer at posteo.de
Sat Apr 6 19:07:34 CEST 2024


Hi,

thank you for the answer, I have tested it: If setting openout_any to a, 
all works fine.

However, my users are no TeX experts, they actually know next to nothing 
about TeX, so that's a problem.

I cannot change $TEXMFOUTPUT because my main output should still be in 
the crrent directory. Just a few files should be created in some other 
place.

Also, I cannot use os.rename() either (for miving the file to the target 
folder, after it was written), since that seems ot listen to the same 
settings, too.

Cheers
Karl-Heinz

Am 06.04.2024 18:26 schrieb Norbert Preining:
> Hi
> 
> I am not an expert in luatex, but ..
> 
>> \directlua{
>> local name = "../Testfile"
>> local myDocument = assert (io.open (name, "w"), [[Could not open file 
>> "]] ..
>> name .. [[" for writing]])
>>>> }
> 
> The news https://tug.org/texlive/doc/texlive-en/texlive-en.html#news
> state:
> 
> 	LuaTeX:
> 
> 	Lua-level checks for writing to files now similar to the TeX-level 
> checks.
> 
> which means writing to files outside the CWD is not allowed anymore.
> 
> This can be seen in tl/2024/texmf-dist/web2c/texmf.cnf:
> 
> ***
> % Do we allow TeX \input or \openin (openin_any), or \openout
> % (openout_any) on filenames starting with `.' (e.g., .rhosts) or
> % outside the current tree (e.g., /etc/passwd)?
> % a (any)        : any file can be opened.
> % r (restricted) : disallow opening dot files
> % p (paranoid)   : as `r' and disallow going to parent directories, and
> %                  restrict absolute paths to be under $TEXMFOUTPUT.
> openin_any = a
> openout_any = p
> ***
> 
> So openout_any = p = paranoid = disallow going to parent directories
> 
> Best regards
> 
> Norbert
> 
> --
> PREINING Norbert                              https://www.preining.info
> arXiv / Cornell University   +   IFMGA Guide   +   TU Wien  +  TeX Live
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



More information about the tex-live mailing list.