Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit 3900bfd

Browse files
author
Yevgeny Pats
committed
bugfix in v2.4.49
1 parent 92ef222 commit 3900bfd

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

client/agent.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (c *FuzzitClient) runlibFuzzerMerge() error {
108108
return err
109109
}
110110
if err := c.archiveAndUpload("merge",
111-
fmt.Sprintf("orgs/%s/targets/%s/corpus.tar.gz", c.Org, c.targetId),
111+
fmt.Sprintf("orgs/%s/targets/%s/corpus.tar.gz", c.Org, c.currentJob.TargetId),
112112
"corpus.tar.gz"); err != nil {
113113
return err
114114
}
@@ -134,16 +134,16 @@ func (c *FuzzitClient) uploadCrash(exitCode int) error {
134134
if _, err := os.Stat("artifact"); err == nil {
135135
log.Printf("uploading crash...")
136136
if err = c.uploadFile("artifact",
137-
fmt.Sprintf("orgs/%s/targets/%s/crashes/%s-%s", c.Org, c.targetId, c.jobId, os.Getenv("POD_ID")),
137+
fmt.Sprintf("orgs/%s/targets/%s/crashes/%s-%s", c.Org, c.currentJob.TargetId, c.jobId, os.Getenv("POD_ID")),
138138
"crash"); err != nil {
139139
return err
140140
}
141-
colRef := c.firestoreClient.Collection(fmt.Sprintf("orgs/%s/targets/%s/crashes", c.Org, c.targetId))
141+
colRef := c.firestoreClient.Collection(fmt.Sprintf("orgs/%s/targets/%s/crashes", c.Org, c.currentJob.TargetId))
142142
_, _, err = colRef.Add(ctx, crash{
143-
TargetName: c.targetId,
143+
TargetName: c.currentJob.TargetId,
144144
PodId: os.Getenv("POD_ID"),
145145
JobId: c.jobId,
146-
TargetId: c.targetId,
146+
TargetId: c.currentJob.TargetId,
147147
OrgId: c.Org,
148148
ExitCode: uint32(exitCode),
149149
Type: "CRASH",
@@ -191,7 +191,7 @@ func (c *FuzzitClient) runLibFuzzerFuzzing() error {
191191
if err := c.refreshToken(); err != nil {
192192
return err
193193
}
194-
docRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.targetId, c.jobId))
194+
docRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.currentJob.TargetId, c.jobId))
195195
if docRef == nil {
196196
return fmt.Errorf("invalid resource")
197197
}
@@ -325,7 +325,7 @@ func (c *FuzzitClient) transitionToInProgress() error {
325325
job := Job{}
326326
if c.updateDB {
327327
// transaction doesnt work for now at go client with oauth token
328-
jobRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.targetId, c.jobId))
328+
jobRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.currentJob.TargetId, c.jobId))
329329
docsnap, err := jobRef.Get(ctx)
330330
if err != nil {
331331
return err
@@ -352,7 +352,7 @@ func (c *FuzzitClient) transitionStatus(status string) error {
352352
}
353353

354354
// transaction doesnt work for now at go client with oauth token
355-
jobRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.targetId, c.jobId))
355+
jobRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.currentJob.TargetId, c.jobId))
356356
_, err := jobRef.Update(ctx, []firestore.Update{{Path: "status", Value: status}})
357357
if err != nil {
358358
return err
@@ -403,7 +403,7 @@ func (c *FuzzitClient) RunJQFFuzzing() error {
403403
if err := c.refreshToken(); err != nil {
404404
return err
405405
}
406-
docRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.targetId, c.jobId))
406+
docRef := c.firestoreClient.Doc(fmt.Sprintf("orgs/%s/targets/%s/jobs/%s", c.Org, c.currentJob.TargetId, c.jobId))
407407
if docRef == nil {
408408
return fmt.Errorf("invalid resource")
409409
}

client/client.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ import (
88
)
99

1010
const FuzzitEndpoint = "https://app.fuzzit.dev"
11-
const Version = "v2.4.49"
12-
13-
const (
14-
libFuzzerEngine = "libFuzzerEngine"
15-
JQFEngine = "JQF"
16-
)
11+
const Version = "v2.4.50"
1712

1813
type Target struct {
1914
Name string `firestore:"target_name"`
@@ -61,7 +56,6 @@ type FuzzitClient struct {
6156
firestoreClient *firestore.Client
6257
httpClient *http.Client
6358
currentJob Job // this is mainly used by the agent
64-
targetId string // this is mainly used by the agent
6559
jobId string // this is mainly used by the agent
6660
updateDB bool // this is mainly used by the agent
6761
fuzzerFilename string // this is mainly used by the agent

client/commands.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ func (c *FuzzitClient) CreateLocalJob(jobConfig Job, files []string) error {
229229
return err
230230
}
231231
log.Println("Creating container")
232+
log.Printf("org=%s\n", c.Org)
232233
createdContainer, err := cli.ContainerCreate(ctx,
233234
&container.Config{
234235
Env: append(
@@ -246,7 +247,7 @@ func (c *FuzzitClient) CreateLocalJob(jobConfig Job, files []string) error {
246247
echo "Downloading fuzzit cli/agent..."
247248
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/%s/fuzzit_Linux_x86_64
248249
chmod a+x fuzzit
249-
./fuzzit run --type regression %s %s`, Version, c.Org, c.targetId),
250+
./fuzzit run --type regression %s %s`, Version, c.Org, jobConfig.TargetId),
250251
},
251252
AttachStdin: true,
252253
},

0 commit comments

Comments
 (0)