From 54e90826a931e30cb9468a8a9968155989a99f74 Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 23 Aug 2022 12:34:02 +0200
Subject: file_exec: Homogeneize adding the gratuitous send right

---
 libdiskfs/file-exec.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'libdiskfs/file-exec.c')

diff --git a/libdiskfs/file-exec.c b/libdiskfs/file-exec.c
index b1cb33c3..ec9bc424 100644
--- a/libdiskfs/file-exec.c
+++ b/libdiskfs/file-exec.c
@@ -195,6 +195,10 @@ diskfs_S_file_exec_paths (struct protid *cred,
       do
 	{
 	  right = ports_get_send_right (newpi);
+
+	  /* Add a gratuitous send right on the protid to avoid a no-sender, and thus
+	     interrupt the exec, just because we are precisely replacing the calling
+	     process!  */
 	  cred_right = ports_get_send_right (cred);
 #ifdef HAVE_EXEC_EXEC_PATHS
 	  err = exec_exec_paths (execserver,
-- 
cgit v1.2.3