We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e32285 commit be310b9Copy full SHA for be310b9
libbeat/cmd/instance/beat.go
@@ -27,6 +27,7 @@ import (
27
"net"
28
"os"
29
"os/user"
30
+ "path/filepath"
31
"runtime"
32
"runtime/debug"
33
"strconv"
@@ -978,8 +979,8 @@ func (b *Beat) LoadMeta(metaPath string) error {
978
979
980
// file does not exist or ID is invalid or first start time is not defined, let's create a new one
981
- // write temporary file first
982
- tmpFile, err := os.CreateTemp("", "beat_meta")
+ // write temporary file first, use same dir as destination to avoid invalid cross-device links
983
+ tmpFile, err := os.CreateTemp(filepath.Dir(metaPath), "new")
984
if err != nil {
985
return fmt.Errorf("failed to create temporary Beat meta file: %w", err)
986
}
0 commit comments