diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-08-06 16:47:16 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-08-07 15:28:59 +0200 |
| commit | 8af91f61b4d5b8db41cf7d34195bb34c767ef3d4 (patch) | |
| tree | de77f01fcc3adf07f2696bc8393c802b90ab138c /pkg/osutil | |
| parent | c7434a4081b4e809176fab3dd7a154652644678f (diff) | |
syz-manager, syz-hub: share repros between managers via hub
Currently hub allows managers to exchange programs from corpus.
But reproducers are not exchanged and we don't know if a crash
happens on other managers as well or not.
Allow hub to exchange reproducers.
Reproducers are stored in a separate db file with own sequence numbers.
This allows to throttle distribution of reproducers to managers,
so that they are not overloaded with reproducers and don't lose them on restarts.
Based on patch by Andrey Konovalov:
https://github.com/google/syzkaller/pull/325
Fixes #282
Diffstat (limited to 'pkg/osutil')
| -rw-r--r-- | pkg/osutil/osutil.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index fecb5f95b..4fbd04506 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -155,3 +155,13 @@ func WriteFile(filename string, data []byte) error { func WriteExecFile(filename string, data []byte) error { return ioutil.WriteFile(filename, data, DefaultExecPerm) } + +// Return all files in a directory. +func ListDir(dir string) ([]string, error) { + f, err := os.Open(dir) + if err != nil { + return nil, err + } + defer f.Close() + return f.Readdirnames(-1) +} |
