Opened 2 years ago

Last modified 2 years ago

#64020 assigned defect

texlive-basic: TeX ignores openout_any configuration option

Reported by: joel-coffman (Joel Coffman) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: texlive-basic

Description

Possibly an application error or overlooked configuration setting somewhere, but TeX Live 2021 installed by MacPorts appears to ignore the openout_any configuration option in texmf.cnf.

Consider the following minimum working example (mwe.tex):

\newwrite\handle
\immediate\openout\handle=.test.abc
\immediate\write\handle{Hello World!}
\immediate\closeout\handle
\bye

With pdfTeX installed by MacPorts, the openout_any configuration option in /opt/local/etc/texmf/texmf.cnf is set as follows:

% 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

and kpsewhich confirms this value:

$ kpsewhich --all --var-value=openout_any
p

but writing to a hidden (i.e., dot) file succeeds:

$ pdftex mwe.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
(./mwe.tex )
No pages of output.
Transcript written on mwe.log.

and

$ cat .test.abc 
Hello World!

Maybe the issue is that the texmf.cnf configuration is being overridden? No, because providing the configuration value as an environment variable (i.e., openout_any=p pdftex mwe.tex) still executes without error.

In contrast, Debian 11 (bullseye) reports an error:

# pdftex test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
pdftex: Not writing to .test.abc (openout_any = p).

! I can't write on file `.test.abc'.
l.2 \immediate\openout\handle=.test.abc
                                       
(Press Enter to retry, or Control-D to exit; default file extension is `.tex')
Please type another output file name: 
! Emergency stop.
l.2 \immediate\openout\handle=.test.abc
                                       
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.

but providing the configuration value as an environment variable (i.e., openout_any=a pdftex mwe.tex) executes without error. Debian testing (bookworm), which uses TeX Live 2022, has the same behavior as Debian 11 (bullseye).

Thus, it appears that the MacPorts installation of TeX Live ignores the openout_any configuration option.

Change History (1)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dports@… removed
Owner: set to drkp
Status: newassigned
Summary: TeX ignores openout_any configuration optiontexlive-basic: TeX ignores openout_any configuration option
Note: See TracTickets for help on using tickets.