- 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
This commit is contained in:
Jindrich Novy 2006-12-04 12:37:46 +00:00
parent db5e34dcac
commit 909e46b454
3 changed files with 90 additions and 23 deletions

18
mc-cloexec.patch Normal file
View File

@ -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;
}

View File

@ -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

10
mc.spec
View File

@ -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 <jnovy@redhat.com> 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 <jnovy@redhat.com> 4.6.1a-36
- don't crash when temporary directory cannot be created (#217342)