aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@gmail.com>2024-07-09 20:12:54 +0200
committerAndrey Konovalov <andreyknvl@gmail.com>2024-07-10 18:42:45 +0000
commitc699c2eb05c8f8cc8d8e20c5a883689491a03ac0 (patch)
tree04a1f606acecb143d5805e1c9cf223d87c05b96c /dashboard
parentb39dc48b782d2b555dd30968a2aa127423fee7c9 (diff)
dashboard: make repro logs public
PR #4837 added displaying successfull repro logs to syzbot but didn't make the logs publicly-accessible. Fix that.
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/app/access.go9
-rw-r--r--dashboard/app/access_test.go12
2 files changed, 21 insertions, 0 deletions
diff --git a/dashboard/app/access.go b/dashboard/app/access.go
index 912f0e6cf..dadaed7f0 100644
--- a/dashboard/app/access.go
+++ b/dashboard/app/access.go
@@ -99,6 +99,15 @@ func checkTextAccess(c context.Context, r *http.Request, tag string, id int64) (
return checkCrashTextAccess(c, r, "ReproSyz", id)
case textReproC:
return checkCrashTextAccess(c, r, "ReproC", id)
+ case textReproLog:
+ bug, crash, err := checkCrashTextAccess(c, r, "ReproLog", id)
+ if err == nil || err == ErrAccess {
+ return bug, crash, err
+ }
+ // ReproLog might also be referenced from Bug.ReproAttempts.Log
+ // for failed repro attempts, but those are not exposed to non-admins
+ // as of yet, so fallback to normal admin access check.
+ return nil, nil, checkAccessLevel(c, r, AccessAdmin)
case textMachineInfo:
// MachineInfo is deduplicated, so we can't find the exact crash/bug.
// But since machine info is usually the same for all bugs and is not secret,
diff --git a/dashboard/app/access_test.go b/dashboard/app/access_test.go
index 08a759892..315ee341f 100644
--- a/dashboard/app/access_test.go
+++ b/dashboard/app/access_test.go
@@ -226,6 +226,17 @@ func TestAccess(t *testing.T) {
strconv.FormatUint(uint64(crash.ReproSyz), 16)),
},
{
+ level: level,
+ ref: fmt.Sprint(crash.ReproLog),
+ url: fmt.Sprintf("/text?tag=ReproLog&id=%v", crash.ReproLog),
+ },
+ {
+ level: level,
+ ref: fmt.Sprint(crash.ReproLog),
+ url: fmt.Sprintf("/text?tag=ReproLog&x=%v",
+ strconv.FormatUint(uint64(crash.ReproLog), 16)),
+ },
+ {
level: nsLevel,
ref: fmt.Sprint(crash.MachineInfo),
url: fmt.Sprintf("/text?tag=MachineInfo&id=%v", crash.MachineInfo),
@@ -326,6 +337,7 @@ func TestAccess(t *testing.T) {
crashOpen.Report = []byte(accessPrefix + "report")
crashOpen.ReproC = []byte(accessPrefix + "repro c")
crashOpen.ReproSyz = []byte(accessPrefix + "repro syz")
+ crashOpen.ReproLog = []byte(accessPrefix + "repro log")
crashOpen.MachineInfo = []byte(ns + "machine info")
client.ReportCrash(crashOpen)
repOpen := client.pollBug()