iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.

This reduces duplication in the two lists and makes it clearer which
ioctls are needed in the ICL_KERNEL_PROXY case.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34927
This commit is contained in:
John Baldwin 2022-04-18 12:44:36 -07:00
parent e2c5ab094b
commit f0df722733

View File

@ -496,13 +496,18 @@ static void
capsicate(struct iscsid_connection *conn)
{
cap_rights_t rights;
const unsigned long cmds[] = {
#ifdef ICL_KERNEL_PROXY
const unsigned long cmds[] = { ISCSIDCONNECT, ISCSIDSEND, ISCSIDRECEIVE,
ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD, ISCSISREMOVE, ISCSISMODIFY };
#else
const unsigned long cmds[] = { ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD,
ISCSISREMOVE, ISCSISMODIFY };
ISCSIDCONNECT,
ISCSIDSEND,
ISCSIDRECEIVE,
#endif
ISCSIDHANDOFF,
ISCSIDFAIL,
ISCSISADD,
ISCSISREMOVE,
ISCSISMODIFY
};
cap_rights_init(&rights, CAP_IOCTL);
if (caph_rights_limit(conn->conn_iscsi_fd, &rights) < 0)