Tar uncompress can accomodate paths w/ symlinks.#118
Merged
Conversation
- Windows recently changed such that System-user run processes receive C:\Windows\SystemTemp. In turn, the Windows 2019.x stemcell was updated such that C:\Windows\SystemTemp is a symlink to the boshTmpDir (`\var\vcap\data\tmp\` via bosh-agent changes). - This behavior change subsequently caused bosh-utils tests to fail, since these tests attempt to extract tars to a path including a symlink, which tar does not permit. - There are at least two ways to fix this problem: the bosh-utils test environment can arbitarily configure a temp directory that it "knows" does not include a symlink (e.g., by hard-coding to C:\Windows\Temp, which is NOT symlinked). An advantage here is behavior changes are limited to Windows behavior. A disadvantage is this shifts the responsibility for that tar extract destination paths do NOT include symlinks downstream. To be fair, downstream consumers have _ALWAYS_ had this responsibility, _however_, Windows behavior has changed such that it is almost certain that prior invocations of tar extraction with temp dirs that were previously successful will now fail. Alternatively, one can choose to change the tar uncompress behavior such that it will resolve the path _prior_ to an extraction. This has a larger impact in terms of change as it will also affect linux users, HOWEVER, this _should_ represent additive behavior to what consumers previously experienced. That is, current users of this method should be unaffected, including those users who would otherwise be impacted by the Windows stemcell changes. Further, I cannot currently imagine any previously valid invocations that would fail as a result of these changes, thus this latter change seems like a better choice, even given the behavior change. - As mentioned above, this commit should fix any tar extraction issues observed in the DecompressFileToDir function after upgrading to the Windows 2019.87 stemcell. This change should be backwards compatible.
93868c9 to
373c3ee
Compare
373c3ee to
217113a
Compare
- The "home dir" test was failing when the suite was run w/ Github Actions. We see these failures _begin_ with b6aa58b, which I believe was an attempt to address failures occuring as a knock-on effect on the changes in 5ec2200, which apparently did not sufficiently consider the various users which the test can be run as. It doesn't seem like those changes were correct for the Github Actions context, where user.Name does not seem to be set (it may be that the intended string _was_ user.Username, because I'm not sure the filepath.Base was needed for the Name case). In any circumstance, user.Username seems to work for both cases -- if possible it may be sensible to set a hardcoded expectation around the value of this string itself (e.g. as "runneradmin") to make these kind of cross-context failures easier to track down, although I suspect this kind of check would have to switch on environment. - In any case, for now, this change appears to allow _both_ Github Actions and other CI pipeline test runners that may be in use to successfully pass, and also seems to reasonably represent the original intent of the test (the created homedir should contain the username).
217113a to
dea3738
Compare
aramprice
approved these changes
Jun 19, 2025
selzoc
approved these changes
Jun 25, 2025
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.
\var\vcap\data\tmp\via bosh-agent changes).