Restrict stdin if it's not in use.
Reviewed by: emaste, cem Differential Revision: https://reviews.freebsd.org/D8184
This commit is contained in:
parent
a4e3fc54a0
commit
abdfa0b19c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306820
@ -164,6 +164,14 @@ main(int argc, char *argv[])
|
||||
if (cap_fcntls_limit(fd2, fcntls) < 0 && errno != ENOSYS)
|
||||
err(ERR_EXIT, "unable to limit fcntls for %s", file2);
|
||||
|
||||
if (!special) {
|
||||
cap_rights_init(&rights);
|
||||
if (cap_rights_limit(STDIN_FILENO, &rights) < 0 &&
|
||||
errno != ENOSYS) {
|
||||
err(ERR_EXIT, "unable to limit stdio");
|
||||
}
|
||||
}
|
||||
|
||||
if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1)
|
||||
err(ERR_EXIT, "unable to limit stdio");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user