[coreutils/f16] fix sort segfault with multibyte locales (by P.Brady), fix showing ACLs in ls (#805398, caused by #6

Ondrej Vasik ovasik at fedoraproject.org
Mon Mar 26 08:49:01 UTC 2012


commit baa00278c0b2adbea223e52d482e1a511d74e83a
Author: Ondřej Vašík <ovasik at redhat.com>
Date:   Mon Mar 26 10:48:53 2012 +0200

    fix sort segfault with multibyte locales (by P.Brady), fix showing ACLs in ls (#805398, caused by #692823 fix)

 coreutils-8.12-lssymlinkacl.patch |   59 +++++++++
 coreutils-i18n.patch              |  243 ++++++++++++++----------------------
 coreutils.spec                    |   12 ++-
 3 files changed, 165 insertions(+), 149 deletions(-)
---
diff --git a/coreutils-8.12-lssymlinkacl.patch b/coreutils-8.12-lssymlinkacl.patch
new file mode 100644
index 0000000..cb4f699
--- /dev/null
+++ b/coreutils-8.12-lssymlinkacl.patch
@@ -0,0 +1,59 @@
+diff -urNp coreutils-8.12-orig/lib/file-has-acl.c coreutils-8.12/lib/file-has-acl.c
+--- coreutils-8.12-orig/lib/file-has-acl.c	2012-03-26 10:18:40.496707657 +0200
++++ coreutils-8.12/lib/file-has-acl.c	2012-03-26 10:22:36.802430522 +0200
+@@ -322,6 +322,32 @@ acl_nontrivial (int count, struct acl *e
+ 
+ #endif
+ 
++/* acl_extended_file() tests whether a file has an ACL.  But it can trigger
++   unnecessary autofs mounts.  In newer versions of libacl, a function
++   acl_extended_file_nofollow() is available that uses lgetxattr() and
++   therefore does not have this problem.  It is equivalent to
++   acl_extended_file(), except on symbolic links.  */
++
++static int
++acl_extended_file_wrap (char const *name)
++{
++  if ( ! HAVE_ACL_EXTENDED_FILE)
++    return -1;
++
++  if (HAVE_ACL_EXTENDED_FILE_NOFOLLOW)
++    {
++      struct stat sb;
++      if (! lstat (name, &sb) && ! S_ISLNK (sb.st_mode))
++        /* acl_extended_file_nofollow() uses lgetxattr() in order to
++           prevent unnecessary mounts.  It returns the same result as
++           acl_extended_file() since we already know that NAME is not a
++           symbolic link at this point (modulo the TOCTTOU race condition).  */
++        return acl_extended_file_nofollow (name);
++    }
++
++  /* fallback for symlinks and old versions of libacl */
++  return acl_extended_file (name);
++}
+ 
+ /* Return 1 if NAME has a nontrivial access control list, 0 if NAME
+    only has no or a base access control list, and -1 (setting errno)
+@@ -339,20 +365,12 @@ file_has_acl (char const *name, struct s
+       /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */
+       int ret;
+ 
+-      if (HAVE_ACL_EXTENDED_FILE || HAVE_ACL_EXTENDED_FILE_NOFOLLOW) /* Linux */
++      if (HAVE_ACL_EXTENDED_FILE) /* Linux */
+         {
+-#  if HAVE_ACL_EXTENDED_FILE_NOFOLLOW
+-          /* acl_extended_file_nofollow() uses lgetxattr() in order to prevent
+-             unnecessary mounts, but it returns the same result as we already
+-             know that NAME is not a symbolic link at this point (modulo the
+-             TOCTTOU race condition).  */
+-          ret = acl_extended_file_nofollow (name);
+-#  else
+           /* On Linux, acl_extended_file is an optimized function: It only
+              makes two calls to getxattr(), one for ACL_TYPE_ACCESS, one for
+              ACL_TYPE_DEFAULT.  */
+-          ret = acl_extended_file (name);
+-#  endif
++          ret = acl_extended_file_wrap (name);
+         }
+       else /* FreeBSD, MacOS X, IRIX, Tru64 */
+         {
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index 9c4cdf1..e32e053 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -1,36 +1,6 @@
-From 1a1c255481be80d9a559b4783126ebbf48faa9cc Mon Sep 17 00:00:00 2001
-From: Kamil Dudka <kdudka at redhat.com>
-Date: Mon, 30 Jan 2012 12:46:37 +0100
-Subject: [PATCH] coreutils-i18n.patch (Fedora 16)
-
----
- lib/linebuffer.h         |    8 +
- src/cut.c                |  437 ++++++++++++++++++++++++++--
- src/expand.c             |  160 ++++++++++-
- src/fold.c               |  308 ++++++++++++++++++--
- src/join.c               |  346 +++++++++++++++++++---
- src/pr.c                 |  438 +++++++++++++++++++++++++---
- src/sort.c               |  723 +++++++++++++++++++++++++++++++++++++++++++---
- src/unexpand.c           |  226 ++++++++++++++-
- src/uniq.c               |  258 ++++++++++++++++-
- tests/Makefile.am        |    5 +
- tests/misc/cut           |    4 +-
- tests/misc/mb1.I         |    4 +
- tests/misc/mb1.X         |    4 +
- tests/misc/mb2.I         |    4 +
- tests/misc/mb2.X         |    4 +
- tests/misc/sort-mb-tests |   58 ++++
- 16 files changed, 2804 insertions(+), 183 deletions(-)
- create mode 100644 tests/misc/mb1.I
- create mode 100644 tests/misc/mb1.X
- create mode 100644 tests/misc/mb2.I
- create mode 100644 tests/misc/mb2.X
- create mode 100644 tests/misc/sort-mb-tests
-
-diff --git a/lib/linebuffer.h b/lib/linebuffer.h
-index 4050fb0..5eafab4 100644
---- a/lib/linebuffer.h
-+++ b/lib/linebuffer.h
+diff -urNp coreutils-8.12-orig/lib/linebuffer.h coreutils-8.12/lib/linebuffer.h
+--- coreutils-8.12-orig/lib/linebuffer.h	2011-04-24 19:21:45.000000000 +0200
++++ coreutils-8.12/lib/linebuffer.h	2012-03-26 10:10:44.383439379 +0200
 @@ -21,6 +21,11 @@
  
  # include <stdio.h>
@@ -53,10 +23,9 @@ index 4050fb0..5eafab4 100644
  };
  
  /* Initialize linebuffer LINEBUFFER for use. */
-diff --git a/src/cut.c b/src/cut.c
-index e2fe851..097f48a 100644
---- a/src/cut.c
-+++ b/src/cut.c
+diff -urNp coreutils-8.12-orig/src/cut.c coreutils-8.12/src/cut.c
+--- coreutils-8.12-orig/src/cut.c	2011-02-19 18:17:03.000000000 +0100
++++ coreutils-8.12/src/cut.c	2012-03-26 10:10:44.385806690 +0200
 @@ -28,6 +28,11 @@
  #include <assert.h>
  #include <getopt.h>
@@ -201,7 +170,7 @@ index e2fe851..097f48a 100644
  
  /* True if the --output-delimiter=STRING option was specified.  */
  static bool output_delimiter_specified;
-@@ -207,7 +284,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
+@@ -207,7 +284,7 @@ Mandatory arguments to long options are 
    -f, --fields=LIST       select only these fields;  also print any line\n\
                              that contains no delimiter character, unless\n\
                              the -s option is specified\n\
@@ -664,10 +633,9 @@ index e2fe851..097f48a 100644
      }
  
    if (optind == argc)
-diff --git a/src/expand.c b/src/expand.c
-index a562290..543554a 100644
---- a/src/expand.c
-+++ b/src/expand.c
+diff -urNp coreutils-8.12-orig/src/expand.c coreutils-8.12/src/expand.c
+--- coreutils-8.12-orig/src/expand.c	2011-02-19 18:17:03.000000000 +0100
++++ coreutils-8.12/src/expand.c	2012-03-26 10:10:44.386455034 +0200
 @@ -38,12 +38,29 @@
  #include <stdio.h>
  #include <getopt.h>
@@ -855,10 +823,9 @@ index a562290..543554a 100644
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-diff --git a/src/fold.c b/src/fold.c
-index 7880e3c..41466dd 100644
---- a/src/fold.c
-+++ b/src/fold.c
+diff -urNp coreutils-8.12-orig/src/fold.c coreutils-8.12/src/fold.c
+--- coreutils-8.12-orig/src/fold.c	2011-02-19 18:17:03.000000000 +0100
++++ coreutils-8.12/src/fold.c	2012-03-26 10:10:44.388464872 +0200
 @@ -22,12 +22,34 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -940,7 +907,7 @@ index 7880e3c..41466dd 100644
    {"spaces", no_argument, NULL, 's'},
    {"width", required_argument, NULL, 'w'},
    {GETOPT_HELP_OPTION_DECL},
-@@ -78,6 +121,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
+@@ -78,6 +121,7 @@ Mandatory arguments to long options are 
  "), stdout);
        fputs (_("\
    -b, --bytes         count bytes rather than columns\n\
@@ -948,7 +915,7 @@ index 7880e3c..41466dd 100644
    -s, --spaces        break at spaces\n\
    -w, --width=WIDTH   use WIDTH columns instead of 80\n\
  "), stdout);
-@@ -95,7 +139,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
+@@ -95,7 +139,7 @@ Mandatory arguments to long options are 
  static size_t
  adjust_column (size_t column, char c)
  {
@@ -990,7 +957,7 @@ index 7880e3c..41466dd 100644
  
    fadvise (istream, FADVISE_SEQUENTIAL);
  
-@@ -171,6 +199,15 @@ fold_file (char const *filename, size_t width)
+@@ -171,6 +199,15 @@ fold_file (char const *filename, size_t 
                bool found_blank = false;
                size_t logical_end = offset_out;
  
@@ -1006,16 +973,16 @@ index 7880e3c..41466dd 100644
                /* Look for the last blank. */
                while (logical_end)
                  {
-@@ -217,11 +254,221 @@ fold_file (char const *filename, size_t width)
+@@ -217,11 +254,221 @@ fold_file (char const *filename, size_t 
        line_out[offset_out++] = c;
      }
  
 -  saved_errno = errno;
 +  *saved_errno = errno;
-+
-+  if (offset_out)
-+    fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
-+
+ 
+   if (offset_out)
+     fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+ 
 +}
 +
 +#if HAVE_MBRTOWC
@@ -1187,10 +1154,10 @@ index 7880e3c..41466dd 100644
 +    }
 +
 +  *saved_errno = errno;
- 
-   if (offset_out)
-     fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
- 
++
++  if (offset_out)
++    fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
++
 +}
 +#endif
 +
@@ -1256,10 +1223,9 @@ index 7880e3c..41466dd 100644
            break;
  
          case 's':		/* Break at word boundaries. */
-diff --git a/src/join.c b/src/join.c
-index 941185c..c458f58 100644
---- a/src/join.c
-+++ b/src/join.c
+diff -urNp coreutils-8.12-orig/src/join.c coreutils-8.12/src/join.c
+--- coreutils-8.12-orig/src/join.c	2011-02-19 18:17:03.000000000 +0100
++++ coreutils-8.12/src/join.c	2012-03-26 10:10:44.390449445 +0200
 @@ -22,18 +22,32 @@
  #include <sys/types.h>
  #include <getopt.h>
@@ -1478,7 +1444,7 @@ index 941185c..c458f58 100644
  static void
  freeline (struct line *line)
  {
-@@ -308,56 +467,115 @@ keycmp (struct line const *line1, struct line const *line2,
+@@ -308,56 +467,115 @@ keycmp (struct line const *line1, struct
          size_t jf_1, size_t jf_2)
  {
    /* Start of field to compare in each file.  */
@@ -1617,7 +1583,7 @@ index 941185c..c458f58 100644
  }
  
  /* Check that successive input lines PREV and CURRENT from input file
-@@ -438,6 +656,11 @@ get_line (FILE *fp, struct line **linep, int which)
+@@ -438,6 +656,11 @@ get_line (FILE *fp, struct line **linep,
        return false;
      }
  
@@ -1629,7 +1595,7 @@ index 941185c..c458f58 100644
    xfields (line);
  
    if (prevline[which - 1])
-@@ -537,21 +760,28 @@ prfield (size_t n, struct line const *line)
+@@ -537,21 +760,28 @@ prfield (size_t n, struct line const *li
  
  /* Output all the fields in line, other than the join field.  */
  
@@ -1669,7 +1635,7 @@ index 941185c..c458f58 100644
    size_t field;
    struct line const *line;
  
-@@ -596,7 +825,7 @@ prjoin (struct line const *line1, struct line const *line2)
+@@ -596,7 +825,7 @@ prjoin (struct line const *line1, struct
            o = o->next;
            if (o == NULL)
              break;
@@ -1735,10 +1701,9 @@ index 941185c..c458f58 100644
            break;
  
          case NOCHECK_ORDER_OPTION:
-diff --git a/src/pr.c b/src/pr.c
-index 7e6b13c..19db10e 100644
---- a/src/pr.c
-+++ b/src/pr.c
+diff -urNp coreutils-8.12-orig/src/pr.c coreutils-8.12/src/pr.c
+--- coreutils-8.12-orig/src/pr.c	2011-04-25 11:45:49.000000000 +0200
++++ coreutils-8.12/src/pr.c	2012-03-26 10:10:44.394824042 +0200
 @@ -312,6 +312,32 @@
  
  #include <getopt.h>
@@ -2186,7 +2151,7 @@ index 7e6b13c..19db10e 100644
            /* sep_string ends with some spaces */
            if (spaces_not_printed > 0)
              print_white_space ();
-@@ -2306,7 +2444,7 @@ print_clump (COLUMN *p, int n, char *clump)
+@@ -2306,7 +2444,7 @@ print_clump (COLUMN *p, int n, char *clu
     required number of tabs and spaces. */
  
  static void
@@ -2482,10 +2447,9 @@ index 7e6b13c..19db10e 100644
  /* We've just printed some files and need to clean up things before
     looking for more options and printing the next batch of files.
  
-diff --git a/src/sort.c b/src/sort.c
-index 07d6765..fa3c0a9 100644
---- a/src/sort.c
-+++ b/src/sort.c
+diff -urNp coreutils-8.12-orig/src/sort.c coreutils-8.12/src/sort.c
+--- coreutils-8.12-orig/src/sort.c	2011-04-25 11:45:49.000000000 +0200
++++ coreutils-8.12/src/sort.c	2012-03-26 10:12:38.009431063 +0200
 @@ -22,11 +22,20 @@
  
  #include <config.h>
@@ -2616,7 +2580,7 @@ index 07d6765..fa3c0a9 100644
  
  static int
  struct_month_cmp (void const *m1, void const *m2)
-@@ -1230,7 +1299,7 @@ struct_month_cmp (void const *m1, void const *m2)
+@@ -1230,7 +1299,7 @@ struct_month_cmp (void const *m1, void c
  /* Initialize the character class tables. */
  
  static void
@@ -2634,7 +2598,7 @@ index 07d6765..fa3c0a9 100644
    /* If we're not in the "C" locale, read different names for months.  */
    if (hard_LC_TIME)
      {
-@@ -1324,6 +1393,84 @@ specify_nmerge (int oi, char c, char const *s)
+@@ -1324,6 +1393,84 @@ specify_nmerge (int oi, char c, char con
      xstrtol_fatal (e, oi, c, long_options, s);
  }
  
@@ -2719,7 +2683,7 @@ index 07d6765..fa3c0a9 100644
  /* Specify the amount of main memory to use when sorting.  */
  static void
  specify_sort_size (int oi, char c, char const *s)
-@@ -1552,7 +1699,7 @@ buffer_linelim (struct buffer const *buf)
+@@ -1552,7 +1699,7 @@ buffer_linelim (struct buffer const *buf
     by KEY in LINE. */
  
  static char *
@@ -2728,7 +2692,7 @@ index 07d6765..fa3c0a9 100644
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t sword = key->sword;
-@@ -1561,10 +1708,10 @@ begfield (struct line const *line, struct keyfield const *key)
+@@ -1561,10 +1708,10 @@ begfield (struct line const *line, struc
    /* The leading field separator itself is included in a field when -t
       is absent.  */
  
@@ -2741,7 +2705,7 @@ index 07d6765..fa3c0a9 100644
            ++ptr;
          if (ptr < lim)
            ++ptr;
-@@ -1590,11 +1737,70 @@ begfield (struct line const *line, struct keyfield const *key)
+@@ -1590,11 +1737,70 @@ begfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2813,7 +2777,7 @@ index 07d6765..fa3c0a9 100644
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t eword = key->eword, echar = key->echar;
-@@ -1609,10 +1815,10 @@ limfield (struct line const *line, struct keyfield const *key)
+@@ -1609,10 +1815,10 @@ limfield (struct line const *line, struc
       `beginning' is the first character following the delimiting TAB.
       Otherwise, leave PTR pointing at the first `blank' character after
       the preceding field.  */
@@ -2826,7 +2790,7 @@ index 07d6765..fa3c0a9 100644
            ++ptr;
          if (ptr < lim && (eword || echar))
            ++ptr;
-@@ -1658,10 +1864,10 @@ limfield (struct line const *line, struct keyfield const *key)
+@@ -1658,10 +1864,10 @@ limfield (struct line const *line, struc
       */
  
    /* Make LIM point to the end of (one byte past) the current field.  */
@@ -2839,7 +2803,7 @@ index 07d6765..fa3c0a9 100644
        if (newlim)
          lim = newlim;
      }
-@@ -1692,6 +1898,130 @@ limfield (struct line const *line, struct keyfield const *key)
+@@ -1692,6 +1898,130 @@ limfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2970,7 +2934,7 @@ index 07d6765..fa3c0a9 100644
  /* Fill BUF reading from FP, moving buf->left bytes from the end
     of buf->buf to the beginning first.  If EOF is reached and the
     file wasn't terminated by a newline, supply one.  Set up BUF's line
-@@ -1778,8 +2108,22 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file)
+@@ -1778,8 +2108,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
                    else
                      {
                        if (key->skipsblanks)
@@ -2995,7 +2959,7 @@ index 07d6765..fa3c0a9 100644
                        line->keybeg = line_start;
                      }
                  }
-@@ -1900,7 +2244,7 @@ human_numcompare (char const *a, char const *b)
+@@ -1900,7 +2244,7 @@ human_numcompare (char const *a, char co
     hideously fast. */
  
  static int
@@ -3004,7 +2968,7 @@ index 07d6765..fa3c0a9 100644
  {
    while (blanks[to_uchar (*a)])
      a++;
-@@ -1910,6 +2254,25 @@ numcompare (char const *a, char const *b)
+@@ -1910,6 +2254,25 @@ numcompare (char const *a, char const *b
    return strnumcmp (a, b, decimal_point, thousands_sep);
  }
  
@@ -3030,7 +2994,7 @@ index 07d6765..fa3c0a9 100644
  static int
  general_numcompare (char const *sa, char const *sb)
  {
-@@ -1942,7 +2305,7 @@ general_numcompare (char const *sa, char const *sb)
+@@ -1942,7 +2305,7 @@ general_numcompare (char const *sa, char
     Return 0 if the name in S is not recognized.  */
  
  static int
@@ -3039,7 +3003,7 @@ index 07d6765..fa3c0a9 100644
  {
    size_t lo = 0;
    size_t hi = MONTHS_PER_YEAR;
-@@ -2217,15 +2580,14 @@ debug_key (struct line const *line, struct keyfield const *key)
+@@ -2217,15 +2580,14 @@ debug_key (struct line const *line, stru
            char saved = *lim;
            *lim = '\0';
  
@@ -3057,7 +3021,7 @@ index 07d6765..fa3c0a9 100644
            else if (key->general_numeric)
              ignore_value (strtold (beg, &tighter_lim));
            else if (key->numeric || key->human_numeric)
-@@ -2369,7 +2731,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only)
+@@ -2369,7 +2731,7 @@ key_warnings (struct keyfield const *gke
        bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key)
                                   && !(key->schar || key->echar);
        bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y  */
@@ -3066,7 +3030,7 @@ index 07d6765..fa3c0a9 100644
            && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
                || (!key->skipsblanks && key->schar)
                || (!key->skipeblanks && key->echar)))
-@@ -2427,11 +2789,83 @@ key_warnings (struct keyfield const *gkey, bool gkey_only)
+@@ -2427,11 +2789,83 @@ key_warnings (struct keyfield const *gke
      error (0, 0, _("option `-r' only applies to last-resort comparison"));
  }
  
@@ -3132,12 +3096,12 @@ index 07d6765..fa3c0a9 100644
 +    }
 +  while (hi - lo > 1);
 +
-+  if (ea)
-+     *ea = (char *) month;
-+
 +  result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
 +      ? monthtab[lo].val : 0);
 +
++  if (ea && result)
++     *ea = s + strlen (monthtab[lo].name);
++
 +  return result;
 +}
 +#endif
@@ -3151,7 +3115,7 @@ index 07d6765..fa3c0a9 100644
  {
    struct keyfield *key = keylist;
  
-@@ -2516,7 +2950,7 @@ keycompare (struct line const *a, struct line const *b)
+@@ -2516,7 +2950,7 @@ keycompare (struct line const *a, struct
            else if (key->human_numeric)
              diff = human_numcompare (ta, tb);
            else if (key->month)
@@ -3160,7 +3124,7 @@ index 07d6765..fa3c0a9 100644
            else if (key->random)
              diff = compare_random (ta, tlena, tb, tlenb);
            else if (key->version)
-@@ -2632,6 +3066,180 @@ keycompare (struct line const *a, struct line const *b)
+@@ -2632,6 +3066,180 @@ keycompare (struct line const *a, struct
    return key->reverse ? -diff : diff;
  }
  
@@ -3434,10 +3398,9 @@ index 07d6765..fa3c0a9 100644
            }
            break;
  
-diff --git a/src/unexpand.c b/src/unexpand.c
-index 0014375..a10b7d4 100644
---- a/src/unexpand.c
-+++ b/src/unexpand.c
+diff -urNp coreutils-8.12-orig/src/unexpand.c coreutils-8.12/src/unexpand.c
+--- coreutils-8.12-orig/src/unexpand.c	2011-02-19 18:17:03.000000000 +0100
++++ coreutils-8.12/src/unexpand.c	2012-03-26 10:10:44.401556558 +0200
 @@ -39,12 +39,29 @@
  #include <stdio.h>
  #include <getopt.h>
@@ -3691,10 +3654,9 @@ index 0014375..a10b7d4 100644
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-diff --git a/src/uniq.c b/src/uniq.c
-index b35938a..8e952c4 100644
---- a/src/uniq.c
-+++ b/src/uniq.c
+diff -urNp coreutils-8.12-orig/src/uniq.c coreutils-8.12/src/uniq.c
+--- coreutils-8.12-orig/src/uniq.c	2011-04-25 11:45:49.000000000 +0200
++++ coreutils-8.12/src/uniq.c	2012-03-26 10:10:44.403559433 +0200
 @@ -21,6 +21,16 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -3733,7 +3695,7 @@ index b35938a..8e952c4 100644
  
  /* The official name of this program (e.g., no `g' prefix).  */
  #define PROGRAM_NAME "uniq"
-@@ -108,6 +130,10 @@ static enum delimit_method const delimit_method_map[] =
+@@ -108,6 +130,10 @@ static enum delimit_method const delimit
  /* Select whether/how to delimit groups of duplicate lines.  */
  static enum delimit_method delimit_groups;
  
@@ -3744,7 +3706,7 @@ index b35938a..8e952c4 100644
  static struct option const longopts[] =
  {
    {"count", no_argument, NULL, 'c'},
-@@ -207,7 +233,7 @@ size_opt (char const *opt, char const *msgid)
+@@ -207,7 +233,7 @@ size_opt (char const *opt, char const *m
     return a pointer to the beginning of the line's field to be compared. */
  
  static char *
@@ -3753,7 +3715,7 @@ index b35938a..8e952c4 100644
  {
    size_t count;
    char const *lp = line->buffer;
-@@ -227,6 +253,83 @@ find_field (struct linebuffer const *line)
+@@ -227,6 +253,83 @@ find_field (struct linebuffer const *lin
    return line->buffer + i;
  }
  
@@ -3837,7 +3799,7 @@ index b35938a..8e952c4 100644
  /* Return false if two strings OLD and NEW match, true if not.
     OLD and NEW point not to the beginnings of the lines
     but rather to the beginnings of the fields to compare.
-@@ -235,6 +338,8 @@ find_field (struct linebuffer const *line)
+@@ -235,6 +338,8 @@ find_field (struct linebuffer const *lin
  static bool
  different (char *old, char *new, size_t oldlen, size_t newlen)
  {
@@ -3846,7 +3808,7 @@ index b35938a..8e952c4 100644
    if (check_chars < oldlen)
      oldlen = check_chars;
    if (check_chars < newlen)
-@@ -242,14 +347,92 @@ different (char *old, char *new, size_t oldlen, size_t newlen)
+@@ -242,14 +347,92 @@ different (char *old, char *new, size_t 
  
    if (ignore_case)
      {
@@ -3944,7 +3906,7 @@ index b35938a..8e952c4 100644
  
  /* Output the line in linebuffer LINE to standard output
     provided that the switches say it should be output.
-@@ -305,15 +488,43 @@ check_file (const char *infile, const char *outfile, char delimiter)
+@@ -305,15 +488,43 @@ check_file (const char *infile, const ch
      {
        char *prevfield IF_LINT ( = NULL);
        size_t prevlen IF_LINT ( = 0);
@@ -3988,7 +3950,7 @@ index b35938a..8e952c4 100644
            if (prevline->length == 0
                || different (thisfield, prevfield, thislen, prevlen))
              {
-@@ -332,17 +543,26 @@ check_file (const char *infile, const char *outfile, char delimiter)
+@@ -332,17 +543,26 @@ check_file (const char *infile, const ch
        size_t prevlen;
        uintmax_t match_count = 0;
        bool first_delimiter = true;
@@ -4015,7 +3977,7 @@ index b35938a..8e952c4 100644
            if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
              {
                if (ferror (stdin))
-@@ -351,6 +571,14 @@ check_file (const char *infile, const char *outfile, char delimiter)
+@@ -351,6 +571,14 @@ check_file (const char *infile, const ch
              }
            thisfield = find_field (thisline);
            thislen = thisline->length - 1 - (thisfield - thisline->buffer);
@@ -4030,7 +3992,7 @@ index b35938a..8e952c4 100644
            match = !different (thisfield, prevfield, thislen, prevlen);
            match_count += match;
  
-@@ -383,6 +611,9 @@ check_file (const char *infile, const char *outfile, char delimiter)
+@@ -383,6 +611,9 @@ check_file (const char *infile, const ch
                SWAP_LINES (prevline, thisline);
                prevfield = thisfield;
                prevlen = thislen;
@@ -4060,10 +4022,9 @@ index b35938a..8e952c4 100644
    skip_chars = 0;
    skip_fields = 0;
    check_chars = SIZE_MAX;
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 20188a3..2de855c 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
+diff -urNp coreutils-8.12-orig/tests/Makefile.am coreutils-8.12/tests/Makefile.am
+--- coreutils-8.12-orig/tests/Makefile.am	2012-03-26 10:10:12.786431587 +0200
++++ coreutils-8.12/tests/Makefile.am	2012-03-26 10:10:44.404540015 +0200
 @@ -236,6 +236,7 @@ TESTS =						\
    misc/sort-debug-keys				\
    misc/sort-debug-warn				\
@@ -4083,10 +4044,9 @@ index 20188a3..2de855c 100644
    pr/0F						\
    pr/0FF					\
    pr/0FFnt					\
-diff --git a/tests/misc/cut b/tests/misc/cut
-index c905ba9..5a76d85 100755
---- a/tests/misc/cut
-+++ b/tests/misc/cut
+diff -urNp coreutils-8.12-orig/tests/misc/cut coreutils-8.12/tests/misc/cut
+--- coreutils-8.12-orig/tests/misc/cut	2011-02-07 09:25:51.000000000 +0100
++++ coreutils-8.12/tests/misc/cut	2012-03-26 10:10:44.405558576 +0200
 @@ -26,7 +26,7 @@ use strict;
  my $prog = 'cut';
  my $try = "Try \`$prog --help' for more information.\n";
@@ -4105,51 +4065,41 @@ index c905ba9..5a76d85 100755
    ['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
    ['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
    ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
-diff --git a/tests/misc/mb1.I b/tests/misc/mb1.I
-new file mode 100644
-index 0000000..90a0d9a
---- /dev/null
-+++ b/tests/misc/mb1.I
+diff -urNp coreutils-8.12-orig/tests/misc/mb1.I coreutils-8.12/tests/misc/mb1.I
+--- coreutils-8.12-orig/tests/misc/mb1.I	1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.12/tests/misc/mb1.I	2012-03-26 10:10:44.406556899 +0200
 @@ -0,0 +1,4 @@
 +Apple@10
 +Banana@5
 +Citrus@20
 +Cherry@30
-diff --git a/tests/misc/mb1.X b/tests/misc/mb1.X
-new file mode 100644
-index 0000000..310655e
---- /dev/null
-+++ b/tests/misc/mb1.X
+diff -urNp coreutils-8.12-orig/tests/misc/mb1.X coreutils-8.12/tests/misc/mb1.X
+--- coreutils-8.12-orig/tests/misc/mb1.X	1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.12/tests/misc/mb1.X	2012-03-26 10:10:44.406556899 +0200
 @@ -0,0 +1,4 @@
 +Banana@5
 +Apple@10
 +Citrus@20
 +Cherry@30
-diff --git a/tests/misc/mb2.I b/tests/misc/mb2.I
-new file mode 100644
-index 0000000..cbb392a
---- /dev/null
-+++ b/tests/misc/mb2.I
+diff -urNp coreutils-8.12-orig/tests/misc/mb2.I coreutils-8.12/tests/misc/mb2.I
+--- coreutils-8.12-orig/tests/misc/mb2.I	1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.12/tests/misc/mb2.I	2012-03-26 10:10:44.407556588 +0200
 @@ -0,0 +1,4 @@
 +Apple@AA10@@20
 +Banana@AA5@@30
 +Citrus@AA20@@5
 +Cherry@AA30@@10
-diff --git a/tests/misc/mb2.X b/tests/misc/mb2.X
-new file mode 100644
-index 0000000..5f0fc66
---- /dev/null
-+++ b/tests/misc/mb2.X
+diff -urNp coreutils-8.12-orig/tests/misc/mb2.X coreutils-8.12/tests/misc/mb2.X
+--- coreutils-8.12-orig/tests/misc/mb2.X	1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.12/tests/misc/mb2.X	2012-03-26 10:10:44.407556588 +0200
 @@ -0,0 +1,4 @@
 +Citrus@AA20@@5
 +Cherry@AA30@@10
 +Apple@AA10@@20
 +Banana@AA5@@30
-diff --git a/tests/misc/sort-mb-tests b/tests/misc/sort-mb-tests
-new file mode 100644
-index 0000000..bdef0cd
---- /dev/null
-+++ b/tests/misc/sort-mb-tests
+diff -urNp coreutils-8.12-orig/tests/misc/sort-mb-tests coreutils-8.12/tests/misc/sort-mb-tests
+--- coreutils-8.12-orig/tests/misc/sort-mb-tests	1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.12/tests/misc/sort-mb-tests	2012-03-26 10:10:44.408558435 +0200
 @@ -0,0 +1,58 @@
 +#! /bin/sh
 +case $# in
@@ -4209,6 +4159,3 @@ index 0000000..bdef0cd
 +fi
 +test $errors = 0 || errors=1
 +exit $errors
--- 
-1.7.1
-
diff --git a/coreutils.spec b/coreutils.spec
index 5125ebb..8d78f52 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -60,6 +60,9 @@ Patch908: coreutils-getgrouplist.patch
 Patch912: coreutils-overflow.patch
 #compile su with pie flag and RELRO protection
 Patch917: coreutils-8.4-su-pie.patch
+#fix rshowing ls ACLs with acl_extended_file_nofollow
+Patch918: coreutils-8.12-lssymlinkacl.patch
+
 
 #SELINUX Patch - implements Redhat changes
 #(upstream did some SELinux implementation unlike with RedHat patch)
@@ -147,6 +150,9 @@ Libraries for coreutils package.
 %patch950 -p1 -b .selinux
 %patch951 -p1 -b .selinuxman
 
+#later applied
+%patch918 -p1 -b .aclsymlink
+
 chmod a+x tests/misc/sort-mb-tests tests/df/direct tests/chown/basic || :
 
 #fix typos/mistakes in localized documentation(#439410, #440056)
@@ -334,6 +340,10 @@ fi
 %{_libdir}/coreutils
 
 %changelog
+* Mon Mar 26 2012 Ondrej Vasik <ovasik at redhat.com> - 8.12-7
+- fix sort segfault with multibyte locales (by P.Brady)
+- fix showing ACLs in ls (#805398, caused by #692823 fix)
+
 * Mon Jan 30 2012 Kamil Dudka <kdudka at redhat.com> - 8.12-6
 - do not use shebang in sourced colorls.csh
 - su: fix shell suspend in tcsh (#597928)
@@ -392,7 +402,7 @@ fi
 - new upstream release coreutils-8.10
 
 * Sat Jan 08 2011 Dennis Gilmore <dennis at ausil.us> - 8.9-2
-- drop no longer needed mkstemp patch for sparc 
+- drop no longer needed mkstemp patch for sparc
 
 * Tue Jan 04 2011 Ondrej Vasik <ovasik at redhat.com> - 8.9-1
 - new upstream release coreutils-8.9


More information about the scm-commits mailing list