rpms/mc/devel mc-cloexec.patch, NONE, 1.1 mc-extensions.patch, 1.8, 1.9 mc-tmpcrash.patch, 1.1, 1.2 mc.spec, 1.112, 1.113

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Dec 4 12:37:49 UTC 2006


Author: jnovy

Update of /cvs/dist/rpms/mc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv578

Modified Files:
	mc-extensions.patch mc-tmpcrash.patch mc.spec 
Added Files:
	mc-cloexec.patch 
Log Message:
- 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:
 subshell.c |    2 ++
 1 files changed, 2 insertions(+)

--- NEW FILE mc-cloexec.patch ---
--- 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;
 }
 

mc-extensions.patch:
 configure     |    2 -
 configure.ac  |    2 -
 lib/mc.ext.in |   73 ++++++++++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 58 insertions(+), 19 deletions(-)

Index: mc-extensions.patch
===================================================================
RCS file: /cvs/dist/rpms/mc/devel/mc-extensions.patch,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mc-extensions.patch	8 Mar 2006 11:13:51 -0000	1.8
+++ mc-extensions.patch	4 Dec 2006 12:37:46 -0000	1.9
@@ -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 &)
+ 
+ shell/.xbm
+-	Open=bitmap %f
++	Include=image
  
-@@ -330,7 +354,7 @@ shell/.xpm
+ 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

mc-tmpcrash.patch:
 utilunix.c |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)

Index: mc-tmpcrash.patch
===================================================================
RCS file: /cvs/dist/rpms/mc/devel/mc-tmpcrash.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mc-tmpcrash.patch	27 Nov 2006 09:50:00 -0000	1.1
+++ mc-tmpcrash.patch	4 Dec 2006 12:37:46 -0000	1.2
@@ -1,18 +1,39 @@
 --- mc-2006-11-14-16/src/utilunix.c.tmpcrash	2005-07-27 17:03:25.000000000 +0200
-+++ mc-2006-11-14-16/src/utilunix.c	2006-11-27 10:32:54.000000000 +0100
-@@ -274,9 +274,12 @@
- 	/* Need to create directory */
- 	if (mkdir (buffer, S_IRWXU) != 0) {
- 	    fprintf (stderr,
--		     _("Cannot create temporary directory %s: %s\n"),
--		     buffer, unix_error_string (errno));
--	    error = "";
-+		     _("Cannot create temporary directory %s: %s\n%s%s\n"),
-+		     buffer, unix_error_string (errno), 
-+		     _("Temporary files will not be created\n"),
-+		     _("Press any key to continue..."));
-+	    getc (stdin);
-+	    return "/dev/null/";
- 	}
-     }
++++ mc-2006-11-14-16/src/utilunix.c	2006-11-28 13:12:36.000000000 +0100
+@@ -283,34 +283,11 @@
+     if (!error) {
+ 	tmpdir = buffer;
+     } else {
+-	int test_fd;
+-	char *test_fn;
+-	int fallback_ok = 0;
+-
+ 	if (*error)
+ 	    fprintf (stderr, error, buffer);
  
+-	/* Test if sys_tmp is suitable for temporary files */
+-	tmpdir = sys_tmp;
+-	test_fd = mc_mkstemps (&test_fn, "mctest", NULL);
+-	if (test_fd != -1) {
+-	    close (test_fd);
+-	    test_fd = open (test_fn, O_RDONLY);
+-	    if (test_fd != -1) {
+-		close (test_fd);
+-		unlink (test_fn);
+-		fallback_ok = 1;
+-	    }
+-	}
+-
+-	if (fallback_ok) {
+-	    fprintf (stderr, _("Temporary files will be created in %s\n"),
+-		     sys_tmp);
+-	    error = NULL;
+-	} else {
+-	    fprintf (stderr, _("Temporary files will not be created\n"));
+-	    tmpdir = "/dev/null/";
+-	}
++	fprintf (stderr, _("Temporary files will not be created\n"));
++	tmpdir = "/dev/null/";
+ 
+ 	fprintf (stderr, "%s\n", _("Press any key to continue..."));
+ 	getc (stdin);


Index: mc.spec
===================================================================
RCS file: /cvs/dist/rpms/mc/devel/mc.spec,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- mc.spec	27 Nov 2006 09:50:00 -0000	1.112
+++ mc.spec	4 Dec 2006 12:37:46 -0000	1.113
@@ -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 @@
 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 @@
 %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 @@
 %dir %{_sysconfdir}/mc
 
 %changelog
+* Mon Dec  4 2006 Jindrich Novy <jnovy at 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 at redhat.com> 4.6.1a-36
 - don't crash when temporary directory cannot be created (#217342)
 




More information about the fedora-cvs-commits mailing list