mirror of
https://github.com/openbsd/src.git
synced 2026-04-24 22:26:03 +00:00
After fork(2) the pledge(2) in the parent proc can be reduced to
"stdio rpath sendfd" so that it can call {l,}stat/open and sendfd for imsg_*
in order to send fds to the child proc which is already pledged by recvfd to
receive them
OK brynet@ deraadt@
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: file.c,v 1.68 2019/02/05 02:17:32 deraadt Exp $ */
|
||||
/* $OpenBSD: file.c,v 1.69 2019/11/30 14:01:45 mestre Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
|
||||
@@ -207,6 +207,9 @@ main(int argc, char **argv)
|
||||
}
|
||||
close(pair[1]);
|
||||
|
||||
if (pledge("stdio rpath sendfd", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
fclose(magicfp);
|
||||
magicfp = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user