Dear maintainer,

I've prepared an NMU for mc (versioned as 3:4.8.33-1.1) and
uploaded it to DELAYED/5. Please feel free to tell me if I
should delay it longer.

Regards.

(I’ve also filed a trixie-p-u request.)

As announced earlier,
//mirabilos
diff -Nru mc-4.8.33/debian/changelog mc-4.8.33/debian/changelog
--- mc-4.8.33/debian/changelog  2025-01-29 06:43:17.000000000 +0000
+++ mc-4.8.33/debian/changelog  2025-08-26 16:08:19.000000000 +0000
@@ -1,3 +1,10 @@
+mc (3:4.8.33-1.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Added debian/patches/subshell-fd.patch (Closes: #1108061)
+
+ -- Thorsten Glaser <[email protected]>  Tue, 26 Aug 2025 16:08:19 +0000
+
 mc (3:4.8.33-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru mc-4.8.33/debian/patches/series mc-4.8.33/debian/patches/series
--- mc-4.8.33/debian/patches/series     2024-05-02 10:56:45.000000000 +0000
+++ mc-4.8.33/debian/patches/series     2025-08-26 16:04:06.000000000 +0000
@@ -1,5 +1,6 @@
 ## UPSTREAM / FORWARDED:
 2987.patch
+subshell-fd.patch
 
 ## DEBIAN FIXES AND ENHANCEMENTS:
 dummy-zip-password.patch
diff -Nru mc-4.8.33/debian/patches/subshell-fd.patch 
mc-4.8.33/debian/patches/subshell-fd.patch
--- mc-4.8.33/debian/patches/subshell-fd.patch  1970-01-01 00:00:00.000000000 
+0000
+++ mc-4.8.33/debian/patches/subshell-fd.patch  2025-08-26 16:04:06.000000000 
+0000
@@ -0,0 +1,90 @@
+Description: fix accidental use of >&10 for subshells
+ POSIX requires shells to only support fd numbers of up to 9
+ for I/O redirections but mc inserts PS1 with “pwd>&%d”, where
+ %d is subshell_pipe[WRITE] which can be a number ≥ 10 which
+ can cause a number of failures in shells that don’t extend
+ beyond POSIX: an error seen when stracing; a ten-second delay
+ at startup; “Pause after run” ignored…
+ .
+ This patch moves the pipe(2) call to slightly earlier so the
+ chance to get a low enough fd is better.
+Bug: https://github.com/MidnightCommander/mc/issues/4634
+Forwarded: https://github.com/MidnightCommander/mc/pull/4724
+Author: Thorsten Glaser <[email protected]>
+
+--- a/src/subshell/common.c
++++ b/src/subshell/common.c
+@@ -1537,36 +1537,6 @@ init_subshell (void)
+         if (mc_global.shell->type == SHELL_NONE)
+             return;
+ 
+-        /* Open a pty for talking to the subshell */
+-
+-        /* FIXME: We may need to open a fresh pty each time on SVR4 */
+-
+-#ifdef HAVE_OPENPTY
+-        if (openpty (&mc_global.tty.subshell_pty, &subshell_pty_slave, NULL, 
NULL, NULL))
+-        {
+-            fprintf (stderr, "Cannot open master and slave sides of pty: 
%s\n",
+-                     unix_error_string (errno));
+-            mc_global.tty.use_subshell = FALSE;
+-            return;
+-        }
+-#else
+-        mc_global.tty.subshell_pty = pty_open_master (pty_name);
+-        if (mc_global.tty.subshell_pty == -1)
+-        {
+-            fprintf (stderr, "Cannot open master side of pty: %s\r\n", 
unix_error_string (errno));
+-            mc_global.tty.use_subshell = FALSE;
+-            return;
+-        }
+-        subshell_pty_slave = pty_open_slave (pty_name);
+-        if (subshell_pty_slave == -1)
+-        {
+-            fprintf (stderr, "Cannot open slave side of pty %s: %s\r\n",
+-                     pty_name, unix_error_string (errno));
+-            mc_global.tty.use_subshell = FALSE;
+-            return;
+-        }
+-#endif /* HAVE_OPENPTY */
+-
+         /* Create a pipe for receiving the subshell's CWD */
+ 
+         if (mc_global.shell->type == SHELL_TCSH)
+@@ -1608,6 +1578,36 @@ init_subshell (void)
+             mc_global.tty.use_subshell = FALSE;
+             return;
+         }
++
++        /* Open a pty for talking to the subshell */
++
++        /* FIXME: We may need to open a fresh pty each time on SVR4 */
++
++#ifdef HAVE_OPENPTY
++        if (openpty (&mc_global.tty.subshell_pty, &subshell_pty_slave, NULL, 
NULL, NULL))
++        {
++            fprintf (stderr, "Cannot open master and slave sides of pty: 
%s\n",
++                     unix_error_string (errno));
++            mc_global.tty.use_subshell = FALSE;
++            return;
++        }
++#else
++        mc_global.tty.subshell_pty = pty_open_master (pty_name);
++        if (mc_global.tty.subshell_pty == -1)
++        {
++            fprintf (stderr, "Cannot open master side of pty: %s\r\n", 
unix_error_string (errno));
++            mc_global.tty.use_subshell = FALSE;
++            return;
++        }
++        subshell_pty_slave = pty_open_slave (pty_name);
++        if (subshell_pty_slave == -1)
++        {
++            fprintf (stderr, "Cannot open slave side of pty %s: %s\r\n",
++                     pty_name, unix_error_string (errno));
++            mc_global.tty.use_subshell = FALSE;
++            return;
++        }
++#endif /* HAVE_OPENPTY */
+     }
+ 
+     /* Fork the subshell */

Reply via email to