Create temporary files in the target directory#2753
Merged
kientzle merged 2 commits intolibarchive:masterfrom Oct 29, 2025
Merged
Create temporary files in the target directory#2753kientzle merged 2 commits intolibarchive:masterfrom
kientzle merged 2 commits intolibarchive:masterfrom
Conversation
This function performs the equivalent of POSIX dirname(3) on a struct archive_string.
b31f54c to
678f1df
Compare
Whenever we need to create a temporary file while writing to disk on a POSIX system, try to create it in the same directory as the final file instead of the current working directory. The target directory can reasonably be expected to be writable (and if it isn't, creating the file will fail anyway), but the current working directory may not be. While here, consistently use __archive_mkstemp(), and increase the template from six to eight random characters. Fixes: 2e73ea3 ("Fix max path-length metadata writing (libarchive#2243)") Fixes: e12c955 ("Unify temporary directory handling")
678f1df to
1c08abc
Compare
tbkka
approved these changes
Oct 28, 2025
kientzle
approved these changes
Oct 29, 2025
mmatuska
pushed a commit
to mmatuska/libarchive
that referenced
this pull request
Nov 17, 2025
Create temporary files in the target directory (cherry picked from commit d2e8617)
brainhoard-github
pushed a commit
to distro-core-curated-mirrors/poky-contrib
that referenced
this pull request
Nov 24, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add two additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 11f782c1ae9962a2faa98bff3566e49fbf6db017) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
brainhoard-github
pushed a commit
to distro-core-curated-mirrors/poky-contrib
that referenced
this pull request
Nov 24, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add three additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 201eed780c73335c9278db17fe39fb453e16af08) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
jpuhlman
pushed a commit
to MontaVista-OpenSourceTechnology/poky
that referenced
this pull request
Nov 24, 2025
Source: poky MR: 296373 Type: Integration Disposition: Merged from poky-nut ChangeID: 5c9a4d8765576f2170dfd8ca38e4325aaf535295 Description: Pick patch [2] as listed in [1]. To apply it cleanly, add two additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
halstead
pushed a commit
to openembedded/openembedded-core
that referenced
this pull request
Nov 26, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add two additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
brainhoard-github
pushed a commit
to distro-core-curated-mirrors/poky-contrib
that referenced
this pull request
Nov 26, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add two additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 11f782c1ae9962a2faa98bff3566e49fbf6db017) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
halstead
pushed a commit
to openembedded/openembedded-core
that referenced
this pull request
Dec 1, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add three additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
halstead
pushed a commit
to yoctoproject/poky
that referenced
this pull request
Dec 1, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add three additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 201eed780c73335c9278db17fe39fb453e16af08) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
halstead
pushed a commit
to yoctoproject/poky
that referenced
this pull request
Dec 1, 2025
Pick patch [2] as listed in [1]. To apply it cleanly, add two additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 11f782c1ae9962a2faa98bff3566e49fbf6db017) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
jpuhlman
pushed a commit
to MontaVista-OpenSourceTechnology/poky
that referenced
this pull request
Dec 12, 2025
Source: poky MR: 302777 Type: Integration Disposition: Merged from poky ChangeID: 4030876 Description: Pick patch [2] as listed in [1]. To apply it cleanly, add three additional patches from branch patch/3.8. [1] https://github.com/libarchive/libarchive/releases/tag/v3.8.3 [2] libarchive/libarchive#2753 (From OE-Core rev: 201eed780c73335c9278db17fe39fb453e16af08) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
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.
Whenever we need to create a temporary file while writing to disk on a POSIX system, try to create it in the same directory as the final file instead of the current working directory. The target directory can reasonably be expected to be writable (and if it isn't, creating the file will fail anyway), but the current working directory may not be.
While here, consistently use
__archive_mkstemp(), and increase the template from six to eight random characters.Cf. 2e73ea3#commitcomment-167829103