Index: mojo/edk/system/handle_table.cc |
diff --git a/mojo/edk/system/handle_table.cc b/mojo/edk/system/handle_table.cc |
index e123ae9bb83a7adf3154799f5bf2d284f22097cd..985e4edf53b5b070d362419a7d5333fc3b63667b 100644 |
--- a/mojo/edk/system/handle_table.cc |
+++ b/mojo/edk/system/handle_table.cc |
@@ -143,6 +143,11 @@ MojoResult HandleTable::MarkBusyAndStartTransport( |
error_result = MOJO_RESULT_BUSY; |
break; |
} |
+ // Note: "Busy" is "preferred" over "permission denied". |
+ if (!entries[i]->handle.has_all_rights(MOJO_HANDLE_RIGHT_TRANSFER)) { |
+ error_result = MOJO_RESULT_PERMISSION_DENIED; |
+ break; |
+ } |
// Note: By marking the handle as busy here, we're also preventing the |
// same handle from being sent multiple times in the same message. |
entries[i]->busy = true; |