Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT.
PR: 185382 (based on) Submitted by: Loganaden Velvindron Reviewed by: pjd MFC after: 1 week
This commit is contained in:
parent
9e4ed33024
commit
bb7a82ac0d
@ -269,7 +269,7 @@ if_register_receive(struct interface_info *info)
|
||||
if (ioctl(info->rfdesc, BIOCLOCK, NULL) < 0)
|
||||
error("Cannot lock bpf");
|
||||
|
||||
cap_rights_init(&rights, CAP_IOCTL, CAP_POLL_EVENT, CAP_READ);
|
||||
cap_rights_init(&rights, CAP_IOCTL, CAP_EVENT, CAP_READ);
|
||||
if (cap_rights_limit(info->rfdesc, &rights) < 0 && errno != ENOSYS)
|
||||
error("Can't limit bpf descriptor: %m");
|
||||
if (cap_ioctls_limit(info->rfdesc, cmds, 2) < 0 && errno != ENOSYS)
|
||||
|
@ -494,7 +494,7 @@ main(int argc, char *argv[])
|
||||
add_protocol("AF_ROUTE", routefd, routehandler, ifi);
|
||||
if (shutdown(routefd, SHUT_WR) < 0)
|
||||
error("can't shutdown route socket: %m");
|
||||
cap_rights_init(&rights, CAP_POLL_EVENT, CAP_READ);
|
||||
cap_rights_init(&rights, CAP_EVENT, CAP_READ);
|
||||
if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS)
|
||||
error("can't limit route socket: %m");
|
||||
|
||||
|
@ -396,7 +396,7 @@ try_file_ops(int filefd, int dirfd, cap_rights_t rights)
|
||||
pollfd.revents = 0;
|
||||
|
||||
ret = poll(&pollfd, 1, 0);
|
||||
if (rights & CAP_POLL_EVENT)
|
||||
if (rights & CAP_EVENT)
|
||||
CHECK((pollfd.revents & POLLNVAL) == 0);
|
||||
else
|
||||
CHECK((pollfd.revents & POLLNVAL) != 0);
|
||||
@ -546,7 +546,7 @@ test_capabilities(void)
|
||||
TRY(CAP_SEM_POST);
|
||||
TRY(CAP_SEM_WAIT);
|
||||
TRY(CAP_POST_EVENT);
|
||||
TRY(CAP_POLL_EVENT);
|
||||
TRY(CAP_EVENT);
|
||||
TRY(CAP_IOCTL);
|
||||
TRY(CAP_TTYHOOK);
|
||||
TRY(CAP_PDGETPID);
|
||||
|
Loading…
Reference in New Issue
Block a user