fix for internal redirection flags colliding with open/fcntl flags; call memfd_create with MFD_NOEXEC_SEAL; fix for setting $BASH in su-started login shell; fix for unsetting $REPLY after nofork comsubs

This commit is contained in:
Chet Ramey
2024-05-01 11:39:51 -04:00
parent 9c430f6bf3
commit 1f42d15864
17 changed files with 118 additions and 357 deletions
+5 -1
View File
@@ -37,6 +37,10 @@
static int anonunlink (const char *);
#if defined (HAVE_MEMFD_CREATE) && !defined (MFD_NOEXEC_SEAL)
# define MFD_NOEXEC_SEAL 0
#endif
#if defined (HAVE_SHM_OPEN)
#ifndef O_NOFOLLOW
# define O_NOFOLLOW 0
@@ -104,7 +108,7 @@ anonopen (const char *name, int flags, char **fn)
#if defined (HAVE_MEMFD_CREATE)
/* "Names do not affect the behavior of the file descriptor." */
fd = memfd_create ("anonopen", 0);
fd = memfd_create ("anonopen", MFD_NOEXEC_SEAL);
if (fd >= 0)
{
if (fn)