tectonic
tectonic copied to clipboard
shell escape: fixes creation of temporary subdirectories
Fixes #1149. The MR applies the fix as described in https://github.com/tectonic-typesetting/tectonic/issues/1149#issuecomment-1943822679. I added also added some error reporting around the call of std::fs::create_dir_all.
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 :warning: |
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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.
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.
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.
Hey, what's the status of this PR? And what's still needed until it can be merged?