GNU bug report logs - #58117
[PATCH] [SV 63111] Set osync handle to noinherit

Previous Next

Package: emacs;

Reported by: Andreas Schwab <schwab <at> suse.de>

Date: Tue, 27 Sep 2022 14:24:02 UTC

Severity: normal

Tags: notabug, patch

Done: Andreas Schwab <schwab <at> suse.de>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] [SV 63111] Set osync handle to noinherit
Date: Tue, 27 Sep 2022 16:23:04 +0200
* src/posixos.c (osync_setup, osync_parse_mutex): Set osync_handle
to noinherit.
---
 src/posixos.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/posixos.c b/src/posixos.c
index d587f9c8..4097ce15 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -628,7 +628,10 @@ osync_setup ()
 {
   osync_handle = get_tmpfd (&osync_tmpfile);
   if (osync_handle >= 0)
-    sync_parent = 1;
+    {
+      fd_noinherit (osync_handle);
+      sync_parent = 1;
+    }
 }
 
 char *
@@ -662,6 +665,8 @@ osync_parse_mutex (const char *mutex)
     OSS (fatal, NILF, _("cannot open output sync mutex %s: %s"),
          osync_tmpfile, strerror (errno));
 
+  fd_noinherit (osync_handle);
+
   return 1;
 }
 
-- 
2.37.3


-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 2 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.