Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminating ".tex" file special case in kpathsea #1412

Open
kberry opened this issue Jul 11, 2024 · 12 comments
Open

eliminating ".tex" file special case in kpathsea #1412

kberry opened this issue Jul 11, 2024 · 12 comments
Assignees
Labels
category tools enhancement fixed in dev Fixed in development branch, not in stable release

Comments

@kberry
Copy link

kberry commented Jul 11, 2024

(Since no one answered my July 1 mail to latex-team, I'll try here.)

Due to LaTeX's ".tex" file, there has always been a special case in kpathsea to allow writing a file named ".tex" (no other dot files are allowed). I'd like to eliminate the special case (for TL25), since nefarious people could in theory use it and most users probably wouldn't think twice about it. It's not technically more of a security issue than being able to write anything, but still, it would be nice to get rid of it for safety and simplicity.

Right now I gather .tex is created in the current directory by
tools.ins: \generate{\file{.tex}{\from{fileerr.dtx}{return}}}. If I change kpathsea, that write will fail.

The simplest way I can think of to handle this is to have the dtx write to a temp file, say tmpdot.tex, and then move it to .tex outside of TeX, as part of making the distribution. If there's some other way to handle it, then great.

wdyt? --thanks, karl.

@davidcarlisle
Copy link
Member

sorry the email dropped through the cracks.

Another possibility would be not to generate .tex at all but simply have it included in the source distribution.

@kberry
Copy link
Author

kberry commented Jul 11, 2024 via email

@FrankMittelbach
Copy link
Member

Sure, that sounds simplest of all. I just didn't know if you'd up for having a non-dtx-generated file :). --thanks, karl.

CTAN will tell us off for it --- a code file without source ---, but we can refer them to you then :-)

more seriously it probably needs a bit juggling with the set up, but it should be doable, and no it didn't fell through the cracks, at least not here, only I didn't want to address it before Prague, especially not as somebody wants slides in time and I had originally planned for a mindmap talk (my bad I should have realized beforehand that this would become a requirement)

Copy link

This issue has been automatically marked as stale because it has not had recent activity.

@github-actions github-actions bot added the stale label Sep 11, 2024
@kberry
Copy link
Author

kberry commented Sep 11, 2024

Let me just make sure: if I take out the special case allowing ".tex" from kpathsea for the TL25 binaries, you'll adjust latex as needed? Thanks.

@davidcarlisle
Copy link
Member

@kberry I think that's the plan although we haven't changed anything yet

@FrankMittelbach
Copy link
Member

I guess what needs happening is that we have to put the .tex explicitly on github and make sure that it gets copied into the ctan upload.

In addition we probably have to comment out the extration in the .ins file so that Karl's scripts don't generate an error. However, I would prefer to leave that in the .ins file if possible. Thus, @kberry do you really run the .ins files for the latex format or do you simply use the tds tree we provide?

@davidcarlisle
Copy link
Member

davidcarlisle commented Sep 12, 2024

@FrankMittelbach if we leave it in it will hit any end users (not just Karl) who run the docstrip on base.
It might be safer to generate something like empty.tex and have l3build (at least) rename it.

@FrankMittelbach
Copy link
Member

ah true ... then perhaps the .ins file should contain a \Msg line telling people to rename that file at the OS level manually.
And perhaps the name should be longer, e.g., rename-me-with-empty-base-name.tex after all "empty.tex" is not an unlikely real name.

@FrankMittelbach
Copy link
Member

FrankMittelbach commented Sep 12, 2024

anyway, please sort it out ... I'm intending to have some vacation :-)

@davidcarlisle
Copy link
Member

@kberry as far as I can see the restriction on writing "dot files" does not apply to a texlua script calling

os.execute("mv something.tex .tex")

so the pull request #1466 writes something safe from tex and then renames it in the build script (or you would have to rename during texlive integration if not using the supplied tds zip file)

does that sound reasonable?

@kberry
Copy link
Author

kberry commented Sep 12, 2024 via email

josephwright pushed a commit that referenced this issue Sep 15, 2024
@josephwright josephwright added the fixed in dev Fixed in development branch, not in stable release label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category tools enhancement fixed in dev Fixed in development branch, not in stable release
Projects
Status: Pool (unscheduled issues)
Development

No branches or pull requests

4 participants