pkg/atomicwriter: New(): use absolute path for temp-file

Use an absolute path for both the temp-file and the destination-file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-03-09 15:00:00 +01:00
parent 58bd93a625
commit b22431ee9c

View File

@@ -16,7 +16,7 @@ func New(filename string, perm os.FileMode) (io.WriteCloser, error) {
return nil, err
}
f, err := os.CreateTemp(filepath.Dir(filename), ".tmp-"+filepath.Base(filename))
f, err := os.CreateTemp(filepath.Dir(abspath), ".tmp-"+filepath.Base(filename))
if err != nil {
return nil, err
}