aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-13 18:20:06 +0200
committervan Hauser <vh@thc.org>2020-05-13 18:20:06 +0200
commit8cc54424019d64d5dabd5c53277ddb09542b5a1c (patch)
tree7cf01fc302d4dc7cb2ea39a7374dc2eef045d8bd
parentbd94d5fce774e40d874d6efc941998bacad1f933 (diff)
downloadafl++-8cc54424019d64d5dabd5c53277ddb09542b5a1c.tar.gz
fix GNUmakefile
-rw-r--r--GNUmakefile6
-rw-r--r--src/afl-fuzz-init.c18
-rw-r--r--src/afl-fuzz-run.c14
3 files changed, 27 insertions, 11 deletions
diff --git a/GNUmakefile b/GNUmakefile
index eefba857..00b61cd2 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -211,9 +211,9 @@ ifeq "$(shell echo 'int main() { return 0;}' | $(CC) $(CFLAGS) -fsanitize=addres
endif
ifdef ASAN_BUILD
- $(info Compiling ASAN version of binaries)
- CFLAGS+=$(ASAN_CFLAGS)
- LDFLAGS+=$(ASAN_LDFLAGS)
+ $(info Compiling ASAN version of binaries)
+ CFLAGS+=$(ASAN_CFLAGS)
+ LDFLAGS+=$(ASAN_LDFLAGS)
endif
ifeq "$(shell echo '$(HASH)include <sys/ipc.h>@$(HASH)include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index d468f2c8..9b7ead29 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -1383,16 +1383,18 @@ void setup_dirs_fds(afl_state_t *afl) {
}
-/*
- if (afl->is_master) {
+ /*
+ if (afl->is_master) {
- u8 *x = alloc_printf("%s/is_master", afl->sync_dir);
- int fd = open(x, O_CREAT | O_RDWR, 0644);
- if (fd < 0) FATAL("cannot create %s", x);
- close(fd);
+ u8 *x = alloc_printf("%s/%s/is_master", afl->sync_dir, afl->sync_id);
+ int fd = open(x, O_CREAT | O_RDWR, 0644);
+ if (fd < 0) FATAL("cannot create %s", x);
+ free(x);
+ close(fd);
- }
-*/
+ }
+
+ */
if (mkdir(afl->out_dir, 0700)) {
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index d9adb792..bbcd9a99 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -401,6 +401,20 @@ void sync_fuzzers(afl_state_t *afl) {
}
+ /*
+ // a slave only syncs from a master, a master syncs from everyone
+ if (likely(afl->is_slave)) {
+
+ u8 x = alloc_printf("%s/%s/is_master", afl->sync_dir, sd_ent->d_name);
+ int res = access(x, F_OK);
+ free(x);
+ if (res != 0)
+ continue;
+
+ }
+
+ */
+
/* Skip anything that doesn't have a queue/ subdirectory. */
qd_path = alloc_printf("%s/%s/queue", afl->sync_dir, sd_ent->d_name);