add AFL_FORKSRV_UID and AFL_FORKSRV_GID env vars

This commit is contained in:
GRAUX Pierre
2025-04-23 14:39:31 +02:00
parent a9900f02cb
commit c8d1b66af3
23 changed files with 536 additions and 77 deletions

View File

@ -748,10 +748,16 @@ void save_auto(afl_state_t *afl) {
s32 fd;
fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, DEFAULT_PERMISSION);
fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, afl->perm);
if (fd < 0) { PFATAL("Unable to create '%s'", fn); }
if (afl->chown_needed) {
if (fchown(fd, -1, afl->fsrv.gid) == -1) { PFATAL("fchown() failed"); }
}
ck_write(fd, afl->a_extras[i].data, afl->a_extras[i].len, fn);
close(fd);