cumulative F-11 coreutils update - fixes for multibyte patch and

selinux/xattr support
This commit is contained in:
Ondrej Vasik 2009-07-08 14:44:11 +00:00
parent f16db63b05
commit 4f510d965d
3 changed files with 123 additions and 12 deletions

View File

@ -433,7 +433,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+
+ memset (&state, 0, sizeof (mbstate_t));
+
+ if (ptr == lim)
+ if (ptr >= lim)
+ return;
+
+ if (tab != NULL)
@ -464,7 +464,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ }
+ }
+
+ if (sep == lim)
+ if (sep >= lim)
+ break;
+
+ extract_field (line, ptr, sep - ptr);
@ -505,7 +505,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ mblength = (mblength < 1) ? 1 : mblength;
+
+ sep = ptr + mblength;
+ while (sep != lim)
+ while (sep < lim)
+ {
+ state_bak = state;
+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
@ -524,7 +524,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ }
+
+ extract_field (line, ptr, sep - ptr);
+ if (sep == lim)
+ if (sep >= lim)
+ return;
+
+ state_bak = state;
@ -538,7 +538,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ mblength = (mblength < 1) ? 1 : mblength;
+
+ ptr = sep + mblength;
+ while (ptr != lim)
+ while (ptr < lim)
+ {
+ state_bak = state;
+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
@ -556,7 +556,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ ptr += mblength;
+ }
+ }
+ while (ptr != lim);
+ while (ptr < lim);
+ }
+
+ extract_field (line, ptr, lim - ptr);
@ -2204,7 +2204,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
{
struct keyfield const *key = keylist;
@@ -1875,6 +2265,179 @@
@@ -1875,6 +2265,181 @@
return key->reverse ? -diff : diff;
}
@ -2254,6 +2254,8 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ (texta, textb));
+ *lima = savea, *limb = saveb;
+ }
+ else if (key->version)
+ diff = compare_version (texta, lena, textb, lenb);
+ else if (key->month)
+ diff = getmonth (texta, lena) - getmonth (textb, lenb);
+ else
@ -2384,7 +2386,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
/* Compare two lines A and B, returning negative, zero, or positive
depending on whether A compares less than, equal to, or greater than B. */
@@ -2744,7 +3305,7 @@
@@ -2744,7 +3307,7 @@
initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE);
@ -2393,7 +2395,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
hard_LC_TIME = hard_locale (LC_TIME);
#endif
@@ -2765,6 +3326,27 @@
@@ -2765,6 +3328,27 @@
thousands_sep = -1;
}
@ -2421,7 +2423,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
have_read_stdin = false;
inittables ();
@@ -3015,13 +3597,35 @@
@@ -3015,13 +3599,35 @@
case 't':
{
@ -2461,7 +2463,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
else
{
/* Provoke with `sort -txx'. Complain about
@@ -3032,9 +3636,12 @@
@@ -3032,9 +3638,12 @@
quote (optarg));
}
}

97
coreutils-silentmv.patch Normal file
View File

@ -0,0 +1,97 @@
diff -urNp coreutils-7.2-orig/src/copy.c coreutils-7.2/src/copy.c
--- coreutils-7.2-orig/src/copy.c 2009-07-08 16:21:46.000000000 +0200
+++ coreutils-7.2/src/copy.c 2009-07-08 16:31:43.000000000 +0200
@@ -139,6 +139,22 @@ copy_attr_error (struct error_context *c
int err = errno;
va_list ap;
+ if (errno != ENOTSUP && errno != ENODATA)
+ {
+ /* use verror module to print error message */
+ va_start (ap, fmt);
+ verror (0, err, fmt, ap);
+ va_end (ap);
+ }
+}
+
+static void
+copy_attr_allerror (struct error_context *ctx ATTRIBUTE_UNUSED,
+ char const *fmt, ...)
+{
+ int err = errno;
+ va_list ap;
+
/* use verror module to print error message */
va_start (ap, fmt);
verror (0, err, fmt, ap);
@@ -163,12 +179,13 @@ copy_attr_by_fd (char const *src_path, i
{
struct error_context ctx =
{
- .error = copy_attr_error,
+ .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error,
.quote = copy_attr_quote,
.quote_free = copy_attr_free
};
return 0 == attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0,
- x->reduce_diagnostics ? NULL : &ctx);
+ (x->reduce_diagnostics
+ && !x->require_preserve_xattr) ? NULL : &ctx);
}
static bool
@@ -177,12 +194,13 @@ copy_attr_by_name (char const *src_path,
{
struct error_context ctx =
{
- .error = copy_attr_error,
+ .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error,
.quote = copy_attr_quote,
.quote_free = copy_attr_free
};
return 0 == attr_copy_file (src_path, dst_path, 0,
- x-> reduce_diagnostics ? NULL :&ctx);
+ (x-> reduce_diagnostics
+ && !x->require_preserve_xattr) ? NULL :&ctx);
}
#else /* USE_XATTR */
@@ -465,7 +483,7 @@ copy_reg (char const *src_name, char con
security_context_t con = NULL;
if (getfscreatecon (&con) < 0)
{
- if (!x->reduce_diagnostics)
+ if (!x->reduce_diagnostics || x->require_preserve_context)
error (0, errno, _("failed to get file system create context"));
if (x->require_preserve_context)
{
@@ -478,7 +496,7 @@ copy_reg (char const *src_name, char con
{
if (fsetfilecon (dest_desc, con) < 0)
{
- if (!x->reduce_diagnostics)
+ if (!x->reduce_diagnostics || x->require_preserve_context)
error (0, errno,
_("failed to set the security context of %s to %s"),
quote_n (0, dst_name), quote_n (1, con));
@@ -1731,7 +1749,7 @@ copy_internal (char const *src_name, cha
{
if (setfscreatecon (con) < 0)
{
- if (!x->reduce_diagnostics)
+ if (!x->reduce_diagnostics || x->require_preserve_context)
error (0, errno,
_("failed to set default file creation context to %s"),
quote (con));
@@ -1745,9 +1763,9 @@ copy_internal (char const *src_name, cha
}
else
{
- if (errno != ENOTSUP && errno != ENODATA)
+ if ((errno != ENOTSUP && errno != ENODATA) || x->require_preserve_context)
{
- if (!x->reduce_diagnostics)
+ if (!x->reduce_diagnostics || x->require_preserve_context)
error (0, errno,
_("failed to get security context of %s"),
quote (src_name));

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 7.2
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -23,6 +23,7 @@ Source203: coreutils-runuser-l.pamd
# Our patches
Patch100: coreutils-6.10-configuration.patch
Patch101: coreutils-6.10-manpages.patch
Patch102: coreutils-silentmv.patch
# sh-utils
Patch703: sh-utils-2.0.11-dateman.patch
@ -102,6 +103,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
# Our patches
%patch100 -p1 -b .configure
%patch101 -p1 -b .manpages
%patch102 -p1 -b .silentmv
# sh-utils
%patch703 -p1 -b .dateman
@ -309,6 +311,16 @@ fi
/sbin/runuser
%changelog
* Wed Jul 09 2009 Ondrej Vasik <ovasik@redhat.com> 7.2-2
- do not ignore sort's version sort for multibyte locales
(#509688)
- fix segfaults in join (i18n patch) when using multibyte
locales(#497368)
- make mv xattr support failures silent (as is done for
cp -a) - #496142
- do not silence xattr/selinux failures when preserving
those attributes is required
* Tue Mar 31 2009 Ondrej Vasik <ovasik@redhat.com> 7.2-1
- New upstream bugfix release 7.2
- removed applied patches