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

@ -623,10 +623,16 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf,
unlink(q->fname); /* ignore errors */
fd = open(q->fname, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
fd = open(q->fname, O_WRONLY | O_CREAT | O_EXCL, afl->perm);
if (fd < 0) { PFATAL("Unable to create '%s'", q->fname); }
if (afl->chown_needed) {
if (fchown(fd, -1, afl->fsrv.gid) == -1) { PFATAL("fchown() failed"); }
}
ck_write(fd, out_buf, out_len, q->fname);
close(fd);