rpms/coreutils/devel coreutils-6.10-lonebackslash.patch, NONE, 1.1 coreutils-colorls.csh, 1.11, 1.12 coreutils-colorls.sh, 1.10, 1.11 coreutils.spec, 1.202, 1.203

Ondrej Vasik (ovasik) fedora-extras-commits at redhat.com
Thu Mar 27 14:38:44 UTC 2008


Author: ovasik

Update of /cvs/extras/rpms/coreutils/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29855

Modified Files:
	coreutils-colorls.csh coreutils-colorls.sh coreutils.spec 
Added Files:
	coreutils-6.10-lonebackslash.patch 
Log Message:
do not keep system defined LS_COLORS for whole session, some upstream fixes - selinux context in mkdir, backslashes in ptx and paste

coreutils-6.10-lonebackslash.patch:

--- NEW FILE coreutils-6.10-lonebackslash.patch ---
diff -urNp coreutils-6.10-orig/src/mkdir.c coreutils-6.10/src/mkdir.c
--- coreutils-6.10-orig/src/mkdir.c	2008-03-27 14:42:40.000000000 +0100
+++ coreutils-6.10/src/mkdir.c	2008-03-27 14:51:48.000000000 +0100
@@ -211,7 +211,7 @@ main (int argc, char **argv)
   if (scontext && setfscreatecon (scontext) < 0)
     error (EXIT_FAILURE, errno,
 	   _("failed to set default file creation context to %s"),
-	   quote (optarg));
+	   quote (scontext));
 
   if (options.make_ancestor_function || specified_mode)
     {
diff -urNp coreutils-6.10-orig/src/paste.c coreutils-6.10/src/paste.c
--- coreutils-6.10-orig/src/paste.c	2007-11-25 14:23:31.000000000 +0100
+++ coreutils-6.10/src/paste.c	2008-03-27 14:47:02.000000000 +0100
@@ -42,6 +42,7 @@
 #include <sys/types.h>
 #include "system.h"
 #include "error.h"
+#include "quotearg.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "paste"
@@ -79,12 +80,17 @@ static struct option const longopts[] =
 /* Set globals delims and delim_end.  Copy STRPTR to DELIMS, converting
    backslash representations of special characters in STRPTR to their actual
    values. The set of possible backslash characters has been expanded beyond
-   that recognized by the Unix version.  */
+   that recognized by the Unix version.
+   Return 0 upon success.
+   If the string ends in an odd number of backslashes, ignore the
+   final backslash and return nonzero.  */   
 
-static void
+static int
 collapse_escapes (char const *strptr)
 {
   char *strout = xstrdup (strptr);
+  bool backslash_at_end = false;
+
   delims = strout;
 
   while (*strptr)
@@ -123,6 +129,15 @@ collapse_escapes (char const *strptr)
 	      *strout++ = '\v';
 	      break;
 
+	    case '\\':
+	      *strout++ = '\\';
+	      break;
+
+	    case '\0':
+	      backslash_at_end = true;
+	      goto done;
+
+
 	    default:
 	      *strout++ = *strptr;
 	      break;
@@ -130,7 +145,11 @@ collapse_escapes (char const *strptr)
 	  strptr++;
 	}
     }
+
+	done:;
+
   delim_end = strout;
+  return backslash_at_end ? 1 : 0;
 }
 
 /* Report a write error and exit.  */
@@ -481,7 +500,15 @@ main (int argc, char **argv)
   if (optind == argc)
     argv[argc++] = "-";
 
-  collapse_escapes (delim_arg);
+  if (collapse_escapes (delim_arg))
+    {
+      /* Don't use the default quoting style, because that would double the
+	 number of displayed backslashes, making the diagnostic look bogus.  */
+      set_quoting_style (NULL, escape_quoting_style);
+      error (EXIT_FAILURE, 0,
+	     _("delimiter list ends with an unescaped backslash: %s"),
+	     quotearg_colon (delim_arg));
+    }
 
   if (!serial_merge)
     ok = paste_parallel (argc - optind, &argv[optind]);
diff -urNp coreutils-6.10-orig/src/ptx.c coreutils-6.10/src/ptx.c
--- coreutils-6.10-orig/src/ptx.c	2007-11-25 14:23:31.000000000 +0100
+++ coreutils-6.10/src/ptx.c	2008-03-27 14:53:24.000000000 +0100
@@ -387,6 +387,11 @@ copy_unescaped_string (const char *strin
 	    string++;
 	    break;
 
+	    case '\0':		/* lone backslash at end of string */
+	      /* ignore it */
+	      break;
+
+
 	  default:
 	    *cursor++ = '\\';
 	    *cursor++ = *string++;


Index: coreutils-colorls.csh
===================================================================
RCS file: /cvs/extras/rpms/coreutils/devel/coreutils-colorls.csh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- coreutils-colorls.csh	4 Mar 2008 12:04:31 -0000	1.11
+++ coreutils-colorls.csh	27 Mar 2008 14:38:08 -0000	1.12
@@ -1,8 +1,9 @@
 #! /bin/csh -f
 # color-ls initialization
-if ( $?LS_COLORS ) then
-  if ( "$LS_COLORS" != "" ) then
-     #do not override user specified LS_COLORS and use them
+if ( $?USER_LS_COLORS ) then
+  if ( "$USER_LS_COLORS" != "" ) then
+     #when USER_LS_COLORS defined do not override user 
+     #specified LS_COLORS and use them
      goto finish
   endif
 endif


Index: coreutils-colorls.sh
===================================================================
RCS file: /cvs/extras/rpms/coreutils/devel/coreutils-colorls.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- coreutils-colorls.sh	18 Feb 2008 14:37:04 -0000	1.10
+++ coreutils-colorls.sh	27 Mar 2008 14:38:08 -0000	1.11
@@ -1,7 +1,7 @@
 # color-ls initialization
 
-#do not override user LS_COLORS, but use them.
-if [ -z "$LS_COLORS" ]; then
+#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
+if [ -z "$USER_LS_COLORS" ]; then
   
   alias ll='ls -l' 2>/dev/null
   alias l.='ls -d .*' 2>/dev/null


Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/devel/coreutils.spec,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -r1.202 -r1.203
--- coreutils.spec	26 Mar 2008 14:36:37 -0000	1.202
+++ coreutils.spec	27 Mar 2008 14:38:08 -0000	1.203
@@ -1,7 +1,7 @@
 Summary: The GNU core utilities: a set of tools commonly used in shell scripts
 Name:    coreutils
 Version: 6.10
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: GPLv3+
 Group:   System Environment/Base
 Url:     http://www.gnu.org/software/coreutils/
@@ -21,6 +21,7 @@
 Patch1: coreutils-6.10-verbose.patch
 Patch2: coreutils-dddoubleclose.patch
 Patch3: coreutils-mvatomic.patch
+Patch4: coreutils-6.10-lonebackslash.patch
 
 # Our patches
 Patch100: coreutils-chgrp.patch
@@ -101,6 +102,7 @@
 %patch1 -p1 -b .verbose
 %patch2 -p1 -b .doubleclose
 %patch3 -p1 -b .atomic
+%patch4 -p1 -b .backslash
 
 # Our patches
 %patch100 -p1 -b .chgrp
@@ -297,6 +299,14 @@
 /sbin/runuser
 
 %changelog
+* Thu Mar 27 2008 Ondrej Vasik <ovasik at redhat.com> - 6.10-16
+- keep LS_COLORS when USER_LS_COLORS defined
+- someupstream fixes:
+- mkdir -Z invalid-selinux-context dir no longer segfaults
+- ptx with odd number of backslashes no longer leads to buffer
+  overflow
+- paste -d'\' file" no longer ovveruns memory
+
 * Wed Mar 26 2008 Ondrej Vasik <ovasik at redhat.com> - 6.10-15
 - covered correct handling for some test conditions failures
   e.g. root build+selinux active and not running mcstrans(d)




More information about the fedora-extras-commits mailing list