On Thu, Jul 12, 2001 at 08:01:13PM -0400, Roland McGrath wrote:
> proc_setexecdata never deallocates the old port rights.
Isn't the following code doing the job?
if (std_port_array)
{
for (i = 0; i < n_std_ports; i++)
mach_port_deallocate (mach_task_self (), std_port_array[i]);
free (std_port_array);
}
> proc_getexecdata never sets its *portspoly out parameter, so garbage goes
> into the reply message.
>
> I think the only correct thing for proc_getexecdata to do is add a user ref
> to each port and then set *portspoly to MACH_MSG_TYPE_MOVE_SEND.
Together with a cleanup omission, I checked a fix in.
I don't check the return value of mach_port_mod_refs, as I don't think there
are reasonable error conditions. Well, it wouldn't be too hard to roll back
at failure, if you want. Just say so.
2001-07-13 Marcus Brinkmann <[EMAIL PROTECTED]>
* host.c (S_proc_getexecdata): New variable PORTS_ALLOCATED.
Set it if we allocated a new buffer for PORTS. If it is set,
and allocation of a new buffer for INTS fails, unmap the buffer
for PORTS.
* host.c (S_proc_getexecdata): New variable I. Go over all
standard ports and increase the send right user reference by one.
Set *PORTSPOLY to MACH_MSG_TYPE_MOVE_SEND.
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann GNU http://www.gnu.org [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de
_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd