From 909e46b4546eb31f67fa46f380ae25b1023aa7f5 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Mon, 4 Dec 2006 12:37:46 +0000 Subject: [PATCH] - update bindings - attempt to fcntl() descriptors appropriatelly so that subshell doesn't leave them open while execve()ing commands (#217027) - more general fix for #215909 --- mc-cloexec.patch | 18 ++++++++++ mc-extensions.patch | 85 +++++++++++++++++++++++++++++++++------------ mc.spec | 10 +++++- 3 files changed, 90 insertions(+), 23 deletions(-) create mode 100644 mc-cloexec.patch diff --git a/mc-cloexec.patch b/mc-cloexec.patch new file mode 100644 index 0000000..1cdfff5 --- /dev/null +++ b/mc-cloexec.patch @@ -0,0 +1,18 @@ +--- mc-2006-11-14-16/src/subshell.c.desleak 2006-05-08 22:59:48.000000000 +0200 ++++ mc-2006-11-14-16/src/subshell.c 2006-11-23 09:50:30.000000000 +0100 +@@ -1150,6 +1152,7 @@ + #endif /* I_FIND && I_PUSH */ + #endif /* __osf__ || __linux__ */ + ++ fcntl(pty_slave, F_SETFD, FD_CLOEXEC); + return pty_slave; + } + +@@ -1203,6 +1207,7 @@ + } + if ((pty_slave = open (pty_name, O_RDWR)) == -1) + fprintf (stderr, "open (pty_name, O_RDWR): %s\r\n", pty_name); ++ fcntl(pty_slave, F_SETFD, FD_CLOEXEC); + return pty_slave; + } + diff --git a/mc-extensions.patch b/mc-extensions.patch index f4ee46e..3ef6513 100644 --- a/mc-extensions.patch +++ b/mc-extensions.patch @@ -1,6 +1,6 @@ ---- mc-4.6.1a/configure.ac.extensions 2005-11-11 03:03:55.000000000 +0100 -+++ mc-4.6.1a/configure.ac 2006-02-28 11:54:30.000000000 +0100 -@@ -83,7 +83,7 @@ AC_PROG_LN_S +--- mc-2006-11-14-16/configure.ac.extensions 2006-11-14 17:05:09.000000000 +0100 ++++ mc-2006-11-14-16/configure.ac 2006-12-04 12:53:03.000000000 +0100 +@@ -83,7 +83,7 @@ AC_CHECK_TOOL(AR, ar, ar) dnl Only list browsers here that can be run in background (i.e. with `&') @@ -9,9 +9,9 @@ dnl dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used. ---- mc-4.6.1a/configure.extensions 2006-02-15 21:12:35.000000000 +0100 -+++ mc-4.6.1a/configure 2006-02-28 12:03:54.000000000 +0100 -@@ -5791,7 +5791,7 @@ else +--- mc-2006-11-14-16/configure.extensions 2006-11-14 17:05:25.000000000 +0100 ++++ mc-2006-11-14-16/configure 2006-12-04 12:53:03.000000000 +0100 +@@ -5767,7 +5767,7 @@ fi @@ -20,9 +20,9 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 ---- mc-4.6.1a/lib/mc.ext.in.extensions 2005-09-06 11:20:01.000000000 +0200 -+++ mc-4.6.1a/lib/mc.ext.in 2005-12-06 09:22:37.000000000 +0100 -@@ -216,14 +221,25 @@ shell/.7z +--- mc-2006-11-14-16/lib/mc.ext.in.extensions 2006-06-22 15:40:51.000000000 +0200 ++++ mc-2006-11-14-16/lib/mc.ext.in 2006-12-04 13:07:36.000000000 +0100 +@@ -220,14 +220,25 @@ # C shell/.c @@ -50,19 +50,22 @@ Open=%var{EDITOR:vi} %f # Object -@@ -248,9 +264,11 @@ regex/\.(te?xi|texinfo)$ +@@ -251,10 +262,12 @@ + # GNU Info page type/^Info\ text - Open=info -f %f -+ #Open=pinfo %f +- Open=info -f %f ++ #Open=info -f %f ++ Open=pinfo %f shell/.info - Open=info -f %f -+ #Open=pinfo %f +- Open=info -f %f ++ #Open=info -f %f ++ Open=pinfo %f # Manual page # Exception - .so libraries are not manual pages -@@ -319,6 +337,12 @@ type/^PPM +@@ -328,18 +342,24 @@ type/^Netpbm Include=image @@ -73,9 +76,14 @@ + Include=image + shell/.xcf - Open=gimp %f + Open=(gimp %f &) -@@ -330,7 +354,7 @@ shell/.xpm + shell/.xbm +- Open=bitmap %f ++ Include=image + + shell/.xpm + Include=image View=sxpm %f include/image @@ -84,7 +92,7 @@ View=%view{ascii} identify %f #View=%view{ascii} asciiview %f -@@ -348,8 +372,12 @@ regex/\.([wW][aA][wW]22)$ +@@ -357,8 +377,12 @@ Open=vplay -s 22 %f regex/\.([mM][pP]3)$ @@ -99,7 +107,7 @@ regex/\.([oO][gG][gG])$ Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f &); fi -@@ -362,6 +390,9 @@ regex/\.([wW][mM][aA])$ +@@ -371,6 +395,9 @@ Open=mplayer -vo null %f View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f @@ -109,7 +117,7 @@ ### Play lists ### -@@ -386,20 +417,27 @@ regex/\.([mM][oO][vV]|[qQ][tT])$ +@@ -395,20 +422,27 @@ regex/\.([mM][pP]4|[mM][pP][eE]?[gG])$ Include=video @@ -138,7 +146,7 @@ #Open=(gtv %f >/dev/null 2>&1 &) #Open=(xanim %f >/dev/null 2>&1 &) -@@ -408,12 +446,13 @@ include/video +@@ -417,12 +451,13 @@ # Postscript type/^PostScript @@ -154,7 +162,7 @@ #Open=(acroread %f &) #Open=(ghostview %f &) View=%view{ascii} pdftotext %f - -@@ -424,7 +463,7 @@ type/^PDF +@@ -433,7 +468,7 @@ # html regex/\.([hH][tT][mM][lL]?)$ Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null @@ -163,3 +171,36 @@ # StarOffice 5.2 shell/.sdw +@@ -450,22 +485,27 @@ + + # Microsoft Word Document + regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$ +- Open=(abiword %f >/dev/null 2>&1 &) ++ Open=(ooffice %f &) ++# Open=(abiword %f >/dev/null 2>&1 &) + View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f + type/^Microsoft\ Word +- Open=(abiword %f >/dev/null 2>&1 &) ++ Open=(ooffice %f &) ++# Open=(abiword %f >/dev/null 2>&1 &) + View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f + + # RTF document + regex/\.([rR][tT][fF])$ +- Open=(abiword %f >/dev/null 2>&1 &) ++ Open=(ooffice %f &) ++# Open=(abiword %f >/dev/null 2>&1 &) + + # Microsoft Excel Worksheet + regex/\.([xX][lL][sSwW])$ +- Open=(gnumeric %f >/dev/null 2>&1 &) ++ Open=(ooffice %f &) ++# Open=(gnumeric %f >/dev/null 2>&1 &) + View=%view{ascii} xls2csv %f || strings %f + type/^Microsoft\ Excel +- Open=(gnumeric %f >/dev/null 2>&1 &) ++ Open=(ooffice %f &) ++# Open=(gnumeric %f >/dev/null 2>&1 &) + View=%view{ascii} xls2csv %f || strings %f + + # Use OpenOffice.org to open any MS Office documents diff --git a/mc.spec b/mc.spec index fac3438..034cb3b 100644 --- a/mc.spec +++ b/mc.spec @@ -3,7 +3,7 @@ Summary: User-friendly text console file manager and visual shell Name: mc Version: 4.6.1a -Release: 36%{?dist} +Release: 37%{?dist} Epoch: 1 License: GPL Group: System Environment/Shells @@ -28,6 +28,7 @@ Patch11: mc-utf8-8bit-hex.patch Patch12: mc-ipv6.patch Patch13: mc-newlinedir.patch Patch14: mc-tmpcrash.patch +Patch15: mc-cloexec.patch %description Midnight Commander is a visual shell much like a file manager, only @@ -54,6 +55,7 @@ specific files. %patch12 -p1 -b .ipv6 %patch13 -p1 -b .newlinedir %patch14 -p1 -b .tmpcrash +%patch15 -p1 -b .cloexec # convert files in /lib to UTF-8 pushd lib @@ -198,6 +200,12 @@ rm -rf $RPM_BUILD_ROOT %dir %{_sysconfdir}/mc %changelog +* Mon Dec 4 2006 Jindrich Novy 4.6.1a-37 +- update bindings +- attempt to fcntl() descriptors appropriatelly so that subshell + doesn't leave them open while execve()ing commands (#217027) +- more general fix for #215909 + * Thu Nov 27 2006 Jindrich Novy 4.6.1a-36 - don't crash when temporary directory cannot be created (#217342)