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

shell escape: fixes creation of temporary subdirectories #1151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

derchr
Copy link

@derchr derchr commented Feb 15, 2024

Fixes #1149.
The MR applies the fix as described in #1149 (comment).
I added also added some error reporting around the call of std::fs::create_dir_all.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 46.34%. Comparing base (fed29a8) to head (7d2839e).
Report is 15 commits behind head on master.

Files Patch % Lines
src/driver.rs 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1151      +/-   ##
==========================================
- Coverage   46.34%   46.34%   -0.01%     
==========================================
  Files         170      170              
  Lines       65120    65125       +5     
==========================================
+ Hits        30180    30182       +2     
- Misses      34940    34943       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rm-dr
Copy link
Contributor

rm-dr commented Feb 21, 2024

I think this looks good.
The only tests that fail are codecov and clippy, both of which are caused by code outside this PR.

This does remind me of #1145, though. We probably don't want to create the user's home directory if it doesn't already exist.
The directory here will usually be a temporary directory, but this would create a home directory with unexpected permissions if ShellEscapeMode::ExternallyManagedDir points to a subdir of a non-existing home.

@pkgw
Copy link
Collaborator

pkgw commented Feb 22, 2024

Maybe the cap_std crate, mentioned in #1106, would also be helpful for limiting the depth of directory creation? It seems like it might be overkill, but if we're using it anyway, maybe that's OK.

@rm-dr
Copy link
Contributor

rm-dr commented Feb 22, 2024

cap_std isn't in Tectonic yet, and is indeed a bit overkill. This could be handled with some fairly simple logic, once we decide on what Tectonic should do when there is no home directory.

@rm-dr rm-dr added the bug label Feb 27, 2024
@Zelzahn
Copy link

Zelzahn commented Mar 27, 2024

Hey, what's the status of this PR? And what's still needed until it can be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No such file or directory error when using shell escape and tex files in subdirectory
4 participants