Repository navigation
Exit 1 for an existing output folder that can't be written to [patch] - #165
Open
matt-edmondson wants to merge 3 commits into
Open
matt-edmondson wants to merge 3 commits into
matt-edmondson wants to merge 3 commits into
Conversation
Directory.CreateDirectory is a no-op on a folder that already exists, so a read-only output folder got past the #125 check. Every icon was then decoded and processed only to fail at the save, and the run exited 2 as if the inputs were bad. ProcessDirectory now probes the folder with a dot-named DeleteOnClose file before processing anything, so the existing catch in Execute reports it as "Argument validation failed" and exits 1. Fixes #162 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW4hvLssY2rDFbS3wDM
3.1.12 carries GHSA-v76p-62qx-wwq2, and NuGet audit warnings are errors, so restore fails on main and on every PR. Ported from #145. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW4hvLssY2rDFbS3wDM
Contributor
Author
|
This PR's CI is red because of
To unblock
The tests for this change pass locally on 3.1.12 with the audit turned off. With file-permission overrides dropped (non-root), 90 passed and 0 failed. Generated by Claude Code |
… license 3.2.0 is the only release that fixes GHSA-v76p-62qx-wwq2, but its build targets fail any CI build that has no SixLaborsLicenseKey. Picking a license, an audit suppression or another library is a maintainer decision, so this PR goes back to main's dependency set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW4hvLssY2rDFbS3wDM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #162
What changed
ProcessDirectorycalls a newEnsureWritableright afterDirectory.CreateDirectory. It opens a dot-named, uniquely named file in the output folder withFileMode.CreateNewandFileOptions.DeleteOnClose. When the folder is read-only, that throwsUnauthorizedAccessExceptionorIOExceptionbefore any icon is decoded. The existing catch inExecutethen reports "Argument validation failed" and exits 1, which is the same result as an output folder that can't be created.Tests
AnExistingReadOnlyOutputFolderExitsWithInvalidArgumentsAndWritesNothing: the output folder is mode 555 and already exists. The test expects exit 1 and nothing written, the probe included. It reports Inconclusive on Windows, and also when the process can still write to the folder (root, or a file system that ignores mode bits).LeavesNoWriteProbeBehindInAWritableOutputFolder: on a normal run, the output folder holds onlyicon.png.I proved the read-only test outside root by running the test executable under
setpriv --inh-caps=-all --bounding-set=-all, which drops CAP_DAC_OVERRIDE:EnsureWritablecall removed: the read-only test fails, becauseExecutereturned 2 instead of 1.Under plain root, the read-only test reports Inconclusive as designed, and the other 89 pass. CI runners are not root, so the test runs there.
I ran the suite locally with
-p:NuGetAudit=false. Restore onmaincurrently fails with NU1903 on SixLabors.ImageSharp 3.1.12, which #145 bumps.Generated by Claude Code