SHA256
1
0
forked from pool/velociraptor
velociraptor/velociraptor-reproducible-timestamp.diff
Antonio Teixeira 8ffa39547e - Update node modules with security fixes.
* Fixes CVE-2024-39338 (bsc#1229424)
  * Remove CVE-2024-28849-follow-redirects-drop-proxy-authorization.patch
    as the update is included.

OBS-URL: https://build.opensuse.org/package/show/security:sensor/velociraptor?expand=0&rev=82
2024-08-19 21:02:37 +00:00

33 lines
1.1 KiB
Diff

From: Jeff Mahoney <jeffm@suse.com>
Subject: magefile: use stable timestamps for build
In order to create reprodicible builds, we can't have timestamps that vary
without anything else changing.
---
magefiles/magefile.go | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/magefiles/magefile.go
+++ b/magefiles/magefile.go
@@ -472,10 +472,18 @@ func build_gui_files() error {
}
func flags() string {
- timestamp := time.Now().Format(time.RFC3339)
+ timestamp := os.Getenv("VELOCIRAPTOR_BUILD_TIME")
+ if timestamp == "" {
+ timestamp = time.Now().Format(time.RFC3339)
+ }
flags := fmt.Sprintf(` -X "www.velocidex.com/golang/velociraptor/config.build_time=%s"`, timestamp)
- flags += fmt.Sprintf(` -X "www.velocidex.com/golang/velociraptor/config.commit_hash=%s"`, hash())
+ head := os.Getenv("VELOCIRAPTOR_GIT_HEAD")
+ if head == "" {
+ head = hash()
+ }
+
+ flags += fmt.Sprintf(` -X "www.velocidex.com/golang/velociraptor/config.commit_hash=%s"`, head)
// If we are running on the CI pipeline we need to know the run
// number and URL so we can report them.