[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Delete rpc copyout multiname code
From: |
Flavio Cruz |
Subject: |
[PATCH] Delete rpc copyout multiname code |
Date: |
Sun, 11 Dec 2022 01:51:50 -0500 |
---
ipc/ipc_object.c | 56 ------------------------------------------------
ipc/ipc_right.c | 35 ------------------------------
2 files changed, 91 deletions(-)
diff --git a/ipc/ipc_object.c b/ipc/ipc_object.c
index ebe11492..3fd7f92b 100644
--- a/ipc/ipc_object.c
+++ b/ipc/ipc_object.c
@@ -666,62 +666,6 @@ ipc_object_copyout(
return kr;
}
-#if 0
-/* XXX same, but don't check for already-existing send rights */
-kern_return_t
-ipc_object_copyout_multiname(space, object, namep)
- ipc_space_t space;
- ipc_object_t object;
- mach_port_t *namep;
-{
- mach_port_t name;
- ipc_entry_t entry;
- kern_return_t kr;
-
- assert(IO_VALID(object));
- assert(io_otype(object) == IOT_PORT);
-
- is_write_lock(space);
-
- for (;;) {
- if (!space->is_active) {
- is_write_unlock(space);
- return KERN_INVALID_TASK;
- }
-
- kr = ipc_entry_alloc(space, &name, &entry);
- if (kr != KERN_SUCCESS) {
- is_write_unlock(space);
- return kr; /* space is unlocked */
- }
-
- assert(IE_BITS_TYPE(entry->ie_bits) == MACH_PORT_TYPE_NONE);
- assert(entry->ie_object == IO_NULL);
-
- io_lock(object);
- if (!io_active(object)) {
- io_unlock(object);
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
- return KERN_INVALID_CAPABILITY;
- }
-
- entry->ie_object = object;
- break;
- }
-
- /* space is write-locked and active, object is locked and active */
-
- kr = ipc_right_copyout_multiname(space, name, entry, object);
- /* object is unlocked */
- is_write_unlock(space);
-
- if (kr == KERN_SUCCESS)
- *namep = name;
- return kr;
-}
-#endif /* 0 */
-
/*
* Routine: ipc_object_copyout_name
* Purpose:
diff --git a/ipc/ipc_right.c b/ipc/ipc_right.c
index b62c9314..79f70c3d 100644
--- a/ipc/ipc_right.c
+++ b/ipc/ipc_right.c
@@ -1978,41 +1978,6 @@ ipc_right_copyout(
return KERN_SUCCESS;
}
-#if 0
-/*XXX same, but allows multiple duplicate send rights */
-kern_return_t
-ipc_right_copyout_multiname(space, name, entry, object)
- ipc_space_t space;
- mach_port_t name;
- ipc_entry_t entry;
- ipc_object_t object;
-{
- ipc_entry_bits_t bits = entry->ie_bits;
- ipc_port_t port;
-
- assert(IO_VALID(object));
- assert(io_otype(object) == IOT_PORT);
- assert(io_active(object));
- assert(entry->ie_object == object);
-
- port = (ipc_port_t) object;
-
- assert(port->ip_srights > 0);
-
- assert(IE_BITS_TYPE(bits) == MACH_PORT_TYPE_NONE);
- assert(IE_BITS_UREFS(bits) == 0);
-
- /* transfer send right and ref to entry */
- ip_unlock(port);
-
- /* entry is locked holding ref, so can use port */
-
- entry->ie_bits = (bits | MACH_PORT_TYPE_SEND) + 1;
-
- return KERN_SUCCESS;
-}
-#endif
-
/*
* Routine: ipc_right_rename
* Purpose:
--
2.37.2
- [PATCH] Delete rpc copyout multiname code,
Flavio Cruz <=