mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
create .synced/NAMES.last to document last sync attempts
This commit is contained in:
@ -466,6 +466,12 @@ void sync_fuzzers(afl_state_t *afl) {
|
|||||||
|
|
||||||
synced++;
|
synced++;
|
||||||
|
|
||||||
|
/* document the attempt to sync to this instance */
|
||||||
|
|
||||||
|
sprintf(qd_synced_path, "%s/.synced/%s.last", afl->out_dir, sd_ent->d_name);
|
||||||
|
id_fd = open(qd_synced_path, O_RDWR | O_CREAT | O_TRUNC, 0600);
|
||||||
|
if (id_fd >= 0) close(id_fd);
|
||||||
|
|
||||||
/* Skip anything that doesn't have a queue/ subdirectory. */
|
/* Skip anything that doesn't have a queue/ subdirectory. */
|
||||||
|
|
||||||
sprintf(qd_path, "%s/%s/queue", afl->sync_dir, sd_ent->d_name);
|
sprintf(qd_path, "%s/%s/queue", afl->sync_dir, sd_ent->d_name);
|
||||||
@ -490,14 +496,13 @@ void sync_fuzzers(afl_state_t *afl) {
|
|||||||
|
|
||||||
if (id_fd < 0) { PFATAL("Unable to create '%s'", qd_synced_path); }
|
if (id_fd < 0) { PFATAL("Unable to create '%s'", qd_synced_path); }
|
||||||
|
|
||||||
if (read(id_fd, &min_accept, sizeof(u32)) > 0) {
|
if (read(id_fd, &min_accept, sizeof(u32)) == sizeof(u32)) {
|
||||||
|
|
||||||
|
next_min_accept = min_accept;
|
||||||
lseek(id_fd, 0, SEEK_SET);
|
lseek(id_fd, 0, SEEK_SET);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next_min_accept = min_accept;
|
|
||||||
|
|
||||||
/* Show stats */
|
/* Show stats */
|
||||||
|
|
||||||
snprintf(afl->stage_name_buf, STAGE_BUF_SIZE, "sync %u", ++sync_cnt);
|
snprintf(afl->stage_name_buf, STAGE_BUF_SIZE, "sync %u", ++sync_cnt);
|
||||||
|
@ -384,7 +384,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
afl->out_dir = optarg;
|
afl->out_dir = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'M': { /* master sync ID */
|
case 'M': { /* main sync ID */
|
||||||
|
|
||||||
u8 *c;
|
u8 *c;
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S': /* secondary sync id */
|
||||||
|
|
||||||
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
||||||
afl->sync_id = ck_strdup(optarg);
|
afl->sync_id = ck_strdup(optarg);
|
||||||
|
Reference in New Issue
Block a user