Skip to content

Commit bb206c0

Browse files
authored
apk cache: ignore error on cache tmpfile chmod (#1631)
This causes issues on some filesystem types. See chainguard-dev/internal-dev#11366
1 parent 3b7dab4 commit bb206c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/apk/apk/cache.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,11 @@ func (t *cacheTransport) retrieveAndSaveFile(ctx context.Context, request *http.
434434
// Now that symlinks are used to advertise cached files,
435435
// CreateTemp permissions are no longer suitable default,
436436
// update to world readable, group/user writable.
437-
err = tmp.Chmod(os.FileMode(0664))
438-
if err != nil {
439-
return "", fmt.Errorf("unable to chmod temporary cache file: %w", err)
440-
}
437+
// Ignore error, since some filesystem types don't support this,
438+
// and if this fails this should surface in other ways
439+
// (e.g. permission denied trying to read the file).
440+
_ = tmp.Chmod(os.FileMode(0664))
441+
441442
if err := func() error {
442443
defer tmp.Close()
443444
defer resp.Body.Close()

0 commit comments

Comments
 (0)