From e2e50a2471af7c8708d49323a3f000042a032b59 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sun, 7 Feb 2016 20:08:58 -0500 Subject: Cast kernel server port arguments to the correct type. * server.c: Add cast for ipc_port_t arguments that are handled differently. * type.c: Set itKernelPort when the mach_port_t is treated as a ipc_port_t. * type.h: Add itKernelPort to struct ipc_type. --- type.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'type.c') diff --git a/type.c b/type.c index 7565f34..4450b52 100644 --- a/type.c +++ b/type.c @@ -219,16 +219,19 @@ itCalculateNameInfo(ipc_type_t *it) (((it->itInName == MACH_MSG_TYPE_POLYMORPHIC) && (it->itOutName == MACH_MSG_TYPE_POLYMORPHIC)) || MACH_MSG_TYPE_PORT_ANY(it->itInName) || - MACH_MSG_TYPE_PORT_ANY(it->itOutName))) + MACH_MSG_TYPE_PORT_ANY(it->itOutName))) { it->itServerType = "ipc_port_t"; - - if (IsKernelUser && + it->itKernelPort = TRUE; + } else if (IsKernelUser && streql(it->itUserType, "mach_port_t") && (((it->itInName == MACH_MSG_TYPE_POLYMORPHIC) && (it->itOutName == MACH_MSG_TYPE_POLYMORPHIC)) || MACH_MSG_TYPE_PORT_ANY(it->itInName) || - MACH_MSG_TYPE_PORT_ANY(it->itOutName))) + MACH_MSG_TYPE_PORT_ANY(it->itOutName))) { it->itUserType = "ipc_port_t"; + it->itKernelPort = TRUE; + } else + it->itKernelPort = FALSE; if (it->itTransType == strNULL) it->itTransType = it->itServerType; -- cgit v1.2.3