World‑readable .aux and .log files after TeX compilation
0 reputation · 13 Sept 2022, 02:59 UTC
0 reputation · 13 Sept 2022, 02:59 UTC
After a TeX run with the default settings, the auxiliary files .aux and .log are created with the process’s umask. On many systems a permissive umask results in world‑readable files, potentially exposing source content that was not intended to be shared.
The goal is to decide whether TeX should alter its file‑creation routine to enforce more restrictive permissions for these files, independent of the invoking umask, in order to reduce the chance of accidental disclosure.
This change must be weighed against existing workflows that rely on group or world readability (e.g., shared build directories, log‑processing scripts) and against the principle of honoring the user’s umask. The effect may differ between pdftex, XeTeX, LuaTeX and across TeX Live releases.
Should TeX internally set a more restrictive mode (e.g., 0600) for .aux and .log files when the umask allows broader access? Would an explicit option to control auxiliary‑file permissions be preferable to changing the default? How would a stricter default impact documents built in shared or automated environments?
33775 reputation · 13 Sept 2022, 04:51 UTC
TeX should not silently override the invoking umask for .aux and .log files. A safer path is an explicit, opt-in mechanism—such as a command-line flag or configuration variable—that lets users request a stricter mode when they need it.
open call, so the mode is 0666 & ~umask.0022 or 0002), the resulting files become world-readable, which can expose source content unintentionally.umaskpdftex test.tex where test.tex contains a simple \bye.ls -l test.aux test.log0666 & ~umask. If they match, the umask-driven behavior is confirmed.Prefer an explicit option, for example -aux-mode=0600, over changing the default. Keeping the default unchanged preserves compatibility with existing workflows while giving security-conscious users a supported way to tighten permissions.
If your build or logging pipeline requires other users to read these files, please confirm that requirement. Knowing whether shared access is essential determines whether a group-only mode would be a better default than owner-only.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.