mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-09 17:13:08 -10:00
syslogd: Limit rights on procdescs
Reviewed by: jfree, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D58160
This commit is contained in:
1 parent
8a36572392
commit
24816abb87
1 file changed
+5
@@ -3772,6 +3772,7 @@ validate(struct sockaddr *sa, const char *hname)
|
||||
int
|
||||
p_open(const char *prog, int *rpd)
|
||||
{
|
||||
cap_rights_t rights;
|
||||
struct sigaction act = { };
|
||||
int pfd[2], pd;
|
||||
pid_t pid;
|
||||
@@ -3823,6 +3824,10 @@ p_open(const char *prog, int *rpd)
|
||||
dprintf("Warning: cannot change pipe to PID %d to non-blocking"
|
||||
"behaviour.", pid);
|
||||
}
|
||||
|
||||
if (cap_rights_limit(pd,
|
||||
cap_rights_init(&rights, CAP_PDKILL, CAP_EVENT)) == -1)
|
||||
err(1, "cap_rights_limit");
|
||||
*rpd = pd;
|
||||
return (pfd[1]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user