new upstream release 8.30

This commit is contained in:
Kamil Dudka 2018-07-02 11:41:17 +02:00
parent 868a615b18
commit cf6dd7194c
13 changed files with 37 additions and 881 deletions

View File

@ -2,13 +2,13 @@ diff --git a/src/md5sum.c b/src/md5sum.c
index 8e21609..a857d62 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -266,6 +266,9 @@ Print or check %s (%d-bit) checksums.\n\
@@ -265,6 +265,9 @@ Print or check %s (%d-bit) checksums.\n\
else
fputs (_("\
-t, --text read in text mode (default)\n\
"), stdout);
+"), stdout);
+ fputs (_("\
+ Note: There is no difference between binary and text mode option on GNU system.\n\
+"), stdout);
"), stdout);
fputs (_("\
\n\
The following five options are useful only when verifying checksums:\n\
-z, --zero end each output line with NUL, not newline,\n\

View File

@ -5,9 +5,9 @@ Subject: [PATCH] downstream changes to default DIR_COLORS
---
DIR_COLORS | 41 ++++---
DIR_COLORS.256color | 302 ++++++++++++++++++++++++------------------------
DIR_COLORS.lightbgcolor | 215 +++++++++++++++++-----------------
3 files changed, 286 insertions(+), 272 deletions(-)
DIR_COLORS.256color | 300 ++++++++++++++++++++++++------------------------
DIR_COLORS.lightbgcolor | 211 ++++++++++++++++++----------------
3 files changed, 283 insertions(+), 269 deletions(-)
diff --git a/DIR_COLORS b/DIR_COLORS
index d2ea453..27af9d7 100644
@ -21,7 +21,7 @@ index d2ea453..27af9d7 100644
+# You can copy this file to .dir_colors in your $HOME directory to override
+# the system defaults.
+
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
@@ -8,6 +12,9 @@
@ -43,7 +43,7 @@ index d2ea453..27af9d7 100644
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
@@ -185,21 +192,21 @@ EXEC 01;32
@@ -184,21 +191,21 @@ EXEC 01;32
.ogx 01;35
# audio formats
@ -190,7 +190,7 @@ index d2ea453..74c34ba 100644
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
@@ -83,123 +81,123 @@ EXEC 01;32
@@ -83,122 +81,122 @@ EXEC 01;32
#.csh 01;32
# archives or compressed (bright red)
@ -209,7 +209,6 @@ index d2ea453..74c34ba 100644
-.t7z 01;31
-.zip 01;31
-.z 01;31
-.Z 01;31
-.dz 01;31
-.gz 01;31
-.lrz 01;31
@ -256,7 +255,6 @@ index d2ea453..74c34ba 100644
+.t7z 38;5;9
+.zip 38;5;9
+.z 38;5;9
+.Z 38;5;9
+.dz 38;5;9
+.gz 38;5;9
+.lrz 38;5;9
@ -482,11 +480,10 @@ index d2ea453..95d6879 100644
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
@@ -82,107 +91,107 @@ EXEC 01;32
#.sh 01;32
@@ -83,105 +92,105 @@ EXEC 01;32
#.csh 01;32
- # archives or compressed (bright red)
# archives or compressed (bright red)
-.tar 01;31
-.tgz 01;31
-.arc 01;31
@ -502,7 +499,6 @@ index d2ea453..95d6879 100644
-.t7z 01;31
-.zip 01;31
-.z 01;31
-.Z 01;31
-.dz 01;31
-.gz 01;31
-.lrz 01;31
@ -534,7 +530,6 @@ index d2ea453..95d6879 100644
-.swm 01;31
-.dwm 01;31
-.esd 01;31
+# archives or compressed (red)
+.tar 00;31
+.tgz 00;31
+.arc 00;31
@ -550,7 +545,6 @@ index d2ea453..95d6879 100644
+.t7z 00;31
+.zip 00;31
+.z 00;31
+.Z 00;31
+.dz 00;31
+.gz 00;31
+.lrz 00;31

View File

@ -1,124 +0,0 @@
From 0aa9b0a92cb61af76b75b57abfd6ea1a7c627367 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Thu, 28 Dec 2017 15:52:42 -0500
Subject: [PATCH 1/2] doc: clarify chown/chgrp --dereference defaults
* doc/coreutils.texi: the documentation for the --dereference
flag of chown/chgrp states that it is the default mode of
operation. Document that this is only the case when operating
non-recursively.
Upstream-commit: 7597cfa482e42a00a69fb9577ee523762980a9a2
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
doc/coreutils.texi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index de1f2eb..de06c0f 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -10989,7 +10989,7 @@ chown -h -R --from=OLDUSER NEWUSER /
@cindex symbolic links, changing owner
@findex lchown
Do not act on symbolic links themselves but rather on what they point to.
-This is the default.
+This is the default when not operating recursively.
@item -h
@itemx --no-dereference
@@ -11119,7 +11119,7 @@ changed.
@cindex symbolic links, changing owner
@findex lchown
Do not act on symbolic links themselves but rather on what they point to.
-This is the default.
+This is the default when not operating recursively.
@item -h
@itemx --no-dereference
--
2.13.6
From 3fb331864c718e065804049001b573ff94810772 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Thu, 4 Jan 2018 11:38:21 -0500
Subject: [PATCH 2/2] doc: warn about following symlinks recursively in
chown/chgrp
In both chown and chgrp (which shares its code with chown), operating
on symlinks recursively has a window of vulnerability where the
destination user or group can change the target of the operation.
Warn about combining the --dereference, --recursive, and -L flags.
* doc/coreutils.texi (warnOptDerefWithRec): Add macro.
(node chown invocation): Add it to --dereference and -L.
(node chgrp invocation): Likewise.
See also: CVE-2017-18018
Upstream-commit: bc2fd9796403e03bb757b064d44c22fab92e6842
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
doc/coreutils.texi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index de06c0f..24cc85b 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -1428,6 +1428,19 @@ a command line argument is a symbolic link to a directory, traverse it.
In a recursive traversal, traverse every symbolic link to a directory
that is encountered.
@end macro
+
+@c Append the following warning to -L where appropriate (e.g. chown).
+@macro warnOptDerefWithRec
+
+Combining this dereferencing option with the @option{--recursive} option
+may create a security risk:
+During the traversal of the directory tree, an attacker may be able to
+introduce a symlink to an arbitrary target; when the tool reaches that,
+the operation will be performed on the target of that symlink,
+possibly allowing the attacker to escalate privileges.
+
+@end macro
+
@choptL
@macro choptP
@@ -10990,6 +11003,7 @@ chown -h -R --from=OLDUSER NEWUSER /
@findex lchown
Do not act on symbolic links themselves but rather on what they point to.
This is the default when not operating recursively.
+@warnOptDerefWithRec
@item -h
@itemx --no-dereference
@@ -11046,6 +11060,7 @@ Recursively change ownership of directories and their contents.
@xref{Traversing symlinks}.
@choptL
+@warnOptDerefWithRec
@xref{Traversing symlinks}.
@choptP
@@ -11120,6 +11135,7 @@ changed.
@findex lchown
Do not act on symbolic links themselves but rather on what they point to.
This is the default when not operating recursively.
+@warnOptDerefWithRec
@item -h
@itemx --no-dereference
@@ -11175,6 +11191,7 @@ Recursively change the group ownership of directories and their contents.
@xref{Traversing symlinks}.
@choptL
+@warnOptDerefWithRec
@xref{Traversing symlinks}.
@choptP
--
2.13.6

View File

@ -1,228 +0,0 @@
From 42b0e609390e62a900c0d73de60282c8b0f15121 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 5 Apr 2018 08:48:01 -0700
Subject: [PATCH 1/2] fts: treat CIFS like NFS
Problem reported by Kamil Dudka in:
https://lists.gnu.org/r/bug-gnulib/2018-04/msg00015.html
* lib/fts.c (S_MAGIC_CIFS): New macro.
(dirent_inode_sort_may_be_useful, leaf_optimization):
Treat CIFS like NFS.
Upstream-commit: 2e53df541a30d438859087ed4b5a396e04697b9b
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/fts.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/fts.c b/lib/fts.c
index 8f2595d..0689da6 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -685,6 +685,7 @@ enum leaf_optimization
/* Linux-specific constants from coreutils' src/fs.h */
# define S_MAGIC_AFS 0x5346414F
+# define S_MAGIC_CIFS 0xFF534D42
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_PROC 0x9FA0
# define S_MAGIC_REISERFS 0x52654973
@@ -792,8 +793,9 @@ dirent_inode_sort_may_be_useful (FTSENT const *p)
switch (filesystem_type (p))
{
- case S_MAGIC_TMPFS:
+ case S_MAGIC_CIFS:
case S_MAGIC_NFS:
+ case S_MAGIC_TMPFS:
/* On a file system of any of these types, sorting
is unnecessary, and hence wasteful. */
return false;
@@ -827,6 +829,10 @@ leaf_optimization (FTSENT const *p)
/* Although AFS mount points are not counted in st_nlink, they
act like directories. See <https://bugs.debian.org/143111>. */
FALLTHROUGH;
+ case S_MAGIC_CIFS:
+ /* Leaf optimization causes 'find' to abort. See
+ <https://lists.gnu.org/r/bug-gnulib/2018-04/msg00015.html>. */
+ FALLTHROUGH;
case S_MAGIC_NFS:
/* NFS provides usable dirent.d_type but not necessarily for all entries
of large directories, so as per <https://bugzilla.redhat.com/1252549>
--
2.14.3
From bf96f62507931eb296c5b16d7e46c141ad505a1f Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 11 Apr 2018 12:50:35 -0700
Subject: [PATCH 2/2] fts: fix bug in find across filesystems
This fixes a bug I introduced last summer.
Problem reported by Kamil Dudka in:
https://lists.gnu.org/r/bug-gnulib/2018-04/msg00033.html
* lib/fts.c (filesystem_type, dirent_inode_sort_may_be_useful)
(leaf_optimization):
New arg for file descriptor. All callers changed.
(fts_build): Check for whether inodes should be sorted
before closing the directory.
Upstream-commit: 81b8c0d3be98f5a77403599de3d06329b3e7673e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/fts.c | 55 +++++++++++++++++++++++++++++++------------------------
1 file changed, 31 insertions(+), 24 deletions(-)
diff --git a/lib/fts.c b/lib/fts.c
index 0689da6..6420ba1 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -726,11 +726,12 @@ dev_type_compare (void const *x, void const *y)
return ax->st_dev == ay->st_dev;
}
-/* Return the file system type of P, or 0 if not known.
+/* Return the file system type of P with file descriptor FD, or 0 if not known.
+ If FD is negative, P's file descriptor is unavailable.
Try to cache known values. */
static fsword
-filesystem_type (FTSENT const *p)
+filesystem_type (FTSENT const *p, int fd)
{
FTS *sp = p->fts_fts;
Hash_table *h = sp->fts_leaf_optimization_works_ht;
@@ -756,7 +757,7 @@ filesystem_type (FTSENT const *p)
}
/* Look-up failed. Query directly and cache the result. */
- if (fstatfs (p->fts_fts->fts_cwd_fd, &fs_buf) != 0)
+ if (fd < 0 || fstatfs (fd, &fs_buf) != 0)
return 0;
if (h)
@@ -778,12 +779,12 @@ filesystem_type (FTSENT const *p)
return fs_buf.f_type;
}
-/* Return false if it is easy to determine the file system type of the
- directory P, and sorting dirents on inode numbers is known not to
- improve traversal performance with that type of file system.
- Otherwise, return true. */
+/* Return true if sorting dirents on inode numbers is known to improve
+ traversal performance for the directory P with descriptor DIR_FD.
+ Return false otherwise. When in doubt, return true.
+ DIR_FD is negative if unavailable. */
static bool
-dirent_inode_sort_may_be_useful (FTSENT const *p)
+dirent_inode_sort_may_be_useful (FTSENT const *p, int dir_fd)
{
/* Skip the sort only if we can determine efficiently
that skipping it is the right thing to do.
@@ -791,7 +792,7 @@ dirent_inode_sort_may_be_useful (FTSENT const *p)
while the cost of *not* performing it can be O(N^2) with
a very large constant. */
- switch (filesystem_type (p))
+ switch (filesystem_type (p, dir_fd))
{
case S_MAGIC_CIFS:
case S_MAGIC_NFS:
@@ -805,16 +806,17 @@ dirent_inode_sort_may_be_useful (FTSENT const *p)
}
}
-/* Given an FTS entry P for a directory D,
+/* Given an FTS entry P for a directory with descriptor DIR_FD,
return true if it is both useful and valid to apply leaf optimization.
The optimization is useful only for file systems that lack usable
dirent.d_type info. The optimization is valid if an st_nlink value
of at least MIN_DIR_NLINK is an upper bound on the number of
- subdirectories of D, counting "." and ".." as subdirectories. */
+ subdirectories of D, counting "." and ".." as subdirectories.
+ DIR_FD is negative if unavailable. */
static enum leaf_optimization
-leaf_optimization (FTSENT const *p)
+leaf_optimization (FTSENT const *p, int dir_fd)
{
- switch (filesystem_type (p))
+ switch (filesystem_type (p, dir_fd))
{
/* List here the file system types that may lack usable dirent.d_type
info, yet for which the optimization does apply. */
@@ -851,12 +853,13 @@ leaf_optimization (FTSENT const *p)
#else
static bool
-dirent_inode_sort_may_be_useful (FTSENT const *p _GL_UNUSED)
+dirent_inode_sort_may_be_useful (FTSENT const *p _GL_UNUSED,
+ int dir_fd _GL_UNUSED)
{
return true;
}
static enum leaf_optimization
-leaf_optimization (FTSENT const *p _GL_UNUSED)
+leaf_optimization (FTSENT const *p _GL_UNUSED, int dir_fd _GL_UNUSED)
{
return NO_LEAF_OPTIMIZATION;
}
@@ -1050,7 +1053,7 @@ check_for_dir:
if (parent->fts_n_dirs_remaining == 0
&& ISSET(FTS_NOSTAT)
&& ISSET(FTS_PHYSICAL)
- && (leaf_optimization (parent)
+ && (leaf_optimization (parent, sp->fts_cwd_fd)
== NOSTAT_LEAF_OPTIMIZATION))
{
/* nothing more needed */
@@ -1335,6 +1338,7 @@ fts_build (register FTS *sp, int type)
int dir_fd;
FTSENT *cur = sp->fts_cur;
bool continue_readdir = !!cur->fts_dirp;
+ bool sort_by_inode = false;
size_t max_entries;
/* When cur->fts_dirp is non-NULL, that means we should
@@ -1428,7 +1432,7 @@ fts_build (register FTS *sp, int type)
&& ! (ISSET (FTS_NOSTAT) && ISSET (FTS_PHYSICAL)
&& ! ISSET (FTS_SEEDOT)
&& cur->fts_statp->st_nlink == MIN_DIR_NLINK
- && (leaf_optimization (cur)
+ && (leaf_optimization (cur, dir_fd)
!= NO_LEAF_OPTIMIZATION)));
if (descend || type == BREAD)
{
@@ -1589,6 +1593,15 @@ mem1: saved_errno = errno;
tail->fts_link = p;
tail = p;
}
+
+ /* If there are many entries, no sorting function has been
+ specified, and this file system is of a type that may be
+ slow with a large number of entries, arrange to sort the
+ directory entries on increasing inode numbers. */
+ if (nitems == _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
+ && !sp->fts_compar)
+ sort_by_inode = dirent_inode_sort_may_be_useful (cur, dir_fd);
+
++nitems;
if (max_entries <= nitems) {
/* When there are too many dir entries, leave
@@ -1646,13 +1659,7 @@ mem1: saved_errno = errno;
return (NULL);
}
- /* If there are many entries, no sorting function has been specified,
- and this file system is of a type that may be slow with a large
- number of entries, then sort the directory entries on increasing
- inode numbers. */
- if (nitems > _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
- && !sp->fts_compar
- && dirent_inode_sort_may_be_useful (cur)) {
+ if (sort_by_inode) {
sp->fts_compar = fts_compare_ino;
head = fts_sort (sp, head, nitems);
sp->fts_compar = NULL;
--
2.14.3

View File

@ -1,202 +0,0 @@
From 08d69db2f3c0e8506a1d126dd4dcdd0f14071161 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 5 Mar 2018 10:56:29 -0800
Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by Daniel P. Berrangé in:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
* lib/fflush.c (clear_ungetc_buffer_preserving_position)
(disable_seek_optimization, rpl_fflush):
* lib/fpending.c (__fpending):
* lib/fpurge.c (fpurge):
* lib/freadahead.c (freadahead):
* lib/freading.c (freading):
* lib/freadptr.c (freadptr):
* lib/freadseek.c (freadptrinc):
* lib/fseeko.c (fseeko):
* lib/fseterr.c (fseterr):
* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
Define if not already defined.
Upstream-commit: 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/fflush.c | 6 +++---
lib/fpending.c | 2 +-
lib/fpurge.c | 2 +-
lib/freadahead.c | 2 +-
lib/freading.c | 2 +-
lib/freadptr.c | 2 +-
lib/freadseek.c | 2 +-
lib/fseeko.c | 4 ++--
lib/fseterr.c | 2 +-
lib/stdio-impl.h | 6 ++++++
10 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/lib/fflush.c b/lib/fflush.c
index 4e65692..c16da5f 100644
--- a/lib/fflush.c
+++ b/lib/fflush.c
@@ -33,7 +33,7 @@
#undef fflush
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
static void
@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
#endif
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
if (stream == NULL || ! freading (stream))
return fflush (stream);
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
clear_ungetc_buffer_preserving_position (stream);
diff --git a/lib/fpending.c b/lib/fpending.c
index 5811a4a..9e21a16 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
diff --git a/lib/fpurge.c b/lib/fpurge.c
index 408b8fc..3a16000 100644
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
/* Avoid memory leak when there is an active ungetc buffer. */
diff --git a/lib/freadahead.c b/lib/freadahead.c
index f335f04..e7cb77b 100644
--- a/lib/freadahead.c
+++ b/lib/freadahead.c
@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
size_t
freadahead (FILE *fp)
{
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
diff --git a/lib/freading.c b/lib/freading.c
index 78140d2..c9d3344 100644
--- a/lib/freading.c
+++ b/lib/freading.c
@@ -31,7 +31,7 @@ freading (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return ((fp->_flags & _IO_NO_WRITES) != 0
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
&& fp->_IO_read_base != NULL));
diff --git a/lib/freadptr.c b/lib/freadptr.c
index e4cc0b0..aba8dd5 100644
--- a/lib/freadptr.c
+++ b/lib/freadptr.c
@@ -29,7 +29,7 @@ freadptr (FILE *fp, size_t *sizep)
size_t size;
/* Keep this code in sync with freadahead! */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return NULL;
size = fp->_IO_read_end - fp->_IO_read_ptr;
diff --git a/lib/freadseek.c b/lib/freadseek.c
index fcecba6..98726f8 100644
--- a/lib/freadseek.c
+++ b/lib/freadseek.c
@@ -36,7 +36,7 @@ freadptrinc (FILE *fp, size_t increment)
/* Keep this code in sync with freadptr! */
#if HAVE___FREADPTRINC /* musl libc */
__freadptrinc (fp, increment);
-#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#elif defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_ptr += increment;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
diff --git a/lib/fseeko.c b/lib/fseeko.c
index d0f24d8..0ae2b15 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
#endif
/* These tests are based on fpurge.c. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
return -1;
}
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
diff --git a/lib/fseterr.c b/lib/fseterr.c
index 739e545..d998619 100644
--- a/lib/fseterr.c
+++ b/lib/fseterr.c
@@ -29,7 +29,7 @@ fseterr (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 329801a..eeaabab 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */
--
2.16.2

View File

@ -1,101 +0,0 @@
From 67defe5a29936c20a2c102b1b947ce9ea9afc081 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 23 Jan 2018 00:42:04 -0800
Subject: [PATCH] Merge strftime.c changes from glibc
This incorporates:
2017-11-14 [BZ #10871] Implement alternative month names
2017-11-14 [BZ #10871] Abbreviated alternative month names (%Ob)
2017-06-20 Use locale_t, not __locale_t, throughout glibc
* lib/nstrftime.c (ABALTMON_1) [!COMPILE_WIDE]: New macro.
(LOCALE_PARAM) [_LIBC && USE_IN_EXTENDED_LOCALE_MODEL]:
Use locale_t, not __locale_t.
(a_altmonth, f_altmonth, aam_len) [_NL_CURRENT]: New macros.
(__strftime_internal): Add support for alternate months.
Upstream-commit: 4a236f16ce0ef97094ff2f6538d4dba90e72a523
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/nstrftime.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index 8795cd7..5902c49 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -91,6 +91,7 @@ extern char *tzname[];
# define UCHAR_T unsigned char
# define L_(Str) Str
# define NLW(Sym) Sym
+# define ABALTMON_1 _NL_ABALTMON_1
# define MEMCPY(d, s, n) memcpy (d, s, n)
# define STRLEN(s) strlen (s)
@@ -255,7 +256,7 @@ extern char *tzname[];
# undef _NL_CURRENT
# define _NL_CURRENT(category, item) \
(current->values[_NL_ITEM_INDEX (item)].string)
-# define LOCALE_PARAM , __locale_t loc
+# define LOCALE_PARAM , locale_t loc
# define LOCALE_ARG , loc
# define HELPER_LOCALE_ARG , current
#else
@@ -475,12 +476,19 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
# define f_month \
((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
+# define a_altmonth \
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ABALTMON_1) + tp->tm_mon)))
+# define f_altmonth \
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ALTMON_1) + tp->tm_mon)))
# define ampm \
((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \
? NLW(PM_STR) : NLW(AM_STR)))
# define aw_len STRLEN (a_wkday)
# define am_len STRLEN (a_month)
+# define aam_len STRLEN (a_altmonth)
# define ap_len STRLEN (ampm)
#endif
#if HAVE_TZNAME
@@ -808,17 +816,20 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
to_uppcase = true;
to_lowcase = false;
}
- if (modifier != 0)
+ if (modifier == L_('E'))
goto bad_format;
#ifdef _NL_CURRENT
- cpy (am_len, a_month);
+ if (modifier == L_('O'))
+ cpy (aam_len, a_altmonth);
+ else
+ cpy (am_len, a_month);
break;
#else
goto underlying_strftime;
#endif
case L_('B'):
- if (modifier != 0)
+ if (modifier == L_('E'))
goto bad_format;
if (change_case)
{
@@ -826,7 +837,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
to_lowcase = false;
}
#ifdef _NL_CURRENT
- cpy (STRLEN (f_month), f_month);
+ if (modifier == L_('O'))
+ cpy (STRLEN (f_altmonth), f_altmonth);
+ else
+ cpy (STRLEN (f_month), f_month);
break;
#else
goto underlying_strftime;
--
2.14.3

View File

@ -1,104 +0,0 @@
From 5a820c5a312d6a5b7a1a755cd0f81c84f7c676d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 14 Mar 2018 11:31:43 -0700
Subject: [PATCH 1/2] ls: increase the allowed abmon width from 5 to 12
This will impact relatively few languages,
and will make Arabic or Catalan etc.
output unambiguous abbreviated month names.
* src/ls.c (MAX_MON_WIDTH): Increase from 5 to 12.
* tests/ls/abmon-align.sh: Augment to check for ambiguous output.
Fixes https://bugs.gnu.org/30814
Upstream-commit: 5ed2018360ba44f673b1dc74fb3d2927f7fcfae3
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
src/ls.c | 7 +++++--
tests/ls/abmon-align.sh | 9 ++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/ls.c b/src/ls.c
index 4becd06..b2983aa 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1095,8 +1095,11 @@ file_escape_init (void)
variable width abbreviated months and also precomputing/caching
the names was seen to increase the performance of ls significantly. */
-/* max number of display cells to use */
-enum { MAX_MON_WIDTH = 5 };
+/* max number of display cells to use.
+ As of 2018 the abmon for Arabic has entries with width 12.
+ It doesn't make much sense to support wider than this
+ and locales should aim for abmon entries of width <= 5. */
+enum { MAX_MON_WIDTH = 12 };
/* abformat[RECENT][MON] is the format to use for timestamps with
recentness RECENT and month MON. */
enum { ABFORMAT_SIZE = 128 };
diff --git a/tests/ls/abmon-align.sh b/tests/ls/abmon-align.sh
index e474047..a81266b 100755
--- a/tests/ls/abmon-align.sh
+++ b/tests/ls/abmon-align.sh
@@ -32,17 +32,20 @@ for format in "%b" "[%b" "%b]" "[%b]"; do
# The sed usage here is slightly different from the original,
# removing the \(.*\), to avoid triggering misbehavior in at least
# GNU sed 4.2 (possibly miscompiled) on Mac OS X (Darwin 9.8.0).
- n_widths=$(
+ months="$(
LC_ALL=$LOC TIME_STYLE=+"$format" ls -lgG *.ts |
- LC_ALL=C sed 's/.\{15\}//;s/ ..\.ts$//;s/ /./g' |
+ LC_ALL=C sed 's/.\{15\}//;s/ ..\.ts$//;s/ /./g')"
+ n_widths=$(echo "$months" |
while read mon; do echo "$mon" | LC_ALL=$LOC wc -L; done |
uniq | wc -l
)
+ n_dupes=$(echo "$months" | sort | uniq -d | wc -l)
test "$n_widths" = "1" || { fail=1; break 2; }
+ test "$n_dupes" = "0" || { fail=1; break 2; }
done
done
if test "$fail" = "1"; then
- echo "misalignment detected in $LOC locale:"
+ echo "misalignment or ambiguous output in $LOC locale:"
LC_ALL=$LOC TIME_STYLE=+%b ls -lgG *.ts
fi
--
2.14.3
From 58196889eb9621a0bc8a97d7eda1174efb1b078c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Tue, 29 May 2018 10:10:35 -0700
Subject: [PATCH 2/2] tests: fix periodic false failure in month alignment
* tests/ls/abmon-align.sh: Base relative month adjustment
from the middle of the month, to avoid failures due
to months being repeated.
Fixes https://bugs.gnu.org/31644
Upstream-commit: c8eb21c9c0ba00559afc5e0d200085ac656396e0
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
tests/ls/abmon-align.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/ls/abmon-align.sh b/tests/ls/abmon-align.sh
index a81266b..8bd20ae 100755
--- a/tests/ls/abmon-align.sh
+++ b/tests/ls/abmon-align.sh
@@ -19,8 +19,9 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ ls
+mid_month="$(date +%Y-%m-15)" || framework_failure_
for mon in $(seq -w 12); do
- touch -d"+$mon month" $mon.ts || framework_failure_
+ touch -d"$mid_month +$mon month" $mon.ts || framework_failure_
done
--
2.14.3

View File

@ -1,63 +0,0 @@
From 76df06ff8fa39ae0cb0d167b7f622139778dc7d7 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 4 Jan 2018 09:42:10 +0100
Subject: [PATCH] mv -n: do not overwrite the destination
... if it is created by another process after mv has checked its
non-existence.
* src/copy.c (copy_internal): Use renameat2 (..., RENAME_NOREPLACE)
if called by mv -n. If it fails with EEXIST in that case, pretend
successful rename as if the existing destination file was detected
by the preceding lstat call.
Fixes https://bugs.gnu.org/29961
---
src/copy.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/copy.c b/src/copy.c
index 2a804945e..be4e357a8 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -53,6 +53,7 @@
#include "ignore-value.h"
#include "ioblksize.h"
#include "quote.h"
+#include "renameat2.h"
#include "root-uid.h"
#include "same.h"
#include "savedir.h"
@@ -2319,7 +2320,12 @@ copy_internal (char const *src_name, char const *dst_name,
if (x->move_mode)
{
- if (rename (src_name, dst_name) == 0)
+ int flags = 0;
+ if (x->interactive == I_ALWAYS_NO)
+ /* do not replace DST_NAME if it was created since our last check */
+ flags = RENAME_NOREPLACE;
+
+ if (renameat2 (AT_FDCWD, src_name, AT_FDCWD, dst_name, flags) == 0)
{
if (x->verbose)
{
@@ -2351,6 +2357,15 @@ copy_internal (char const *src_name, char const *dst_name,
return true;
}
+ if ((flags & RENAME_NOREPLACE) && (errno == EEXIST))
+ {
+ /* Pretend the rename succeeded, so the caller (mv)
+ doesn't end up removing the source file. */
+ if (rename_succeeded)
+ *rename_succeeded = true;
+ return true;
+ }
+
/* FIXME: someday, consider what to do when moving a directory into
itself but when source and destination are on different devices. */
--
2.13.6

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJaQ+ZxAAoJEN9v2XEwYDfZOF8P/i9zNyDAerVBh6UOyW9ijDZ5
3vSWYzgmNNxUp0BfptJ0xqirH8tKRvgHzoy87Eu5PvmARASKOtnjc1cap885HIto
j5LlGe2t73xoW049dIx00DwsZFo9ef/DZnaSRo96MlW1xXlHtuYTDwR9ovWt5xHx
a+SrzG05kdZlybQ8rLlz5MFxs43IHQHZ0wudlcP2KxlP2HEtBPDto/xmOxw7jVBD
5ZOhiTCB6Dza5QxWGCX3ij1YYEn9mmSsmp6Hp4QteskWlp6mpJEViW2GW6p3zUSe
EqpM9beax1pRKYcBMuXBDtSCS+Sxw//ZybE/p+bY5K2T0Z8zxUd325t4oGnb8uRK
jMBdm9SnlK9bkyouHxY3eK6XNMG/u4YZ/p4jk8QB4YdYN3t7u6aJ6443OgKDlmPF
qfELnZdPvOA9kdC8+oLz37Z/e7HmrZXforxk00qn/GCAVxqHhzu7QbME4/Zzufwt
bHQ2JcVqywmFfv0bI5rs/EpOYJoGOwlVFq/u6mykvzYgrFUgG171eu3SHrkFAWfA
hWz5mL1W3x/SYg/K+ySKlGtrQ877FNSHLOVP5cDme6HgAiV9rWyah44IEDwakyDk
yfDURjKUtNaSq9PAyGUXj4nJ4BklTIyRqiXUfIs8OK9UMPqrJsFSCxzSVAJWsuGL
Q2dcgRAkwMwrwhzed2ot
=QwW/
-----END PGP SIGNATURE-----

17
coreutils-8.30.tar.xz.sig Normal file
View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJbOYLXAAoJEN9v2XEwYDfZFRwP/1xKMtXTqCOnP3ECRze+bYnX
GB5Mm57kcP2NXwzo62+9C+FToEfkRTALtlU95edIRlsjLGBoDvv12fsOKdsyO/c5
7paI3NoaUFyJxby9w91mNOcgN6eR5WZ/LHm2VbTs5VFpsNcSVyHSvhiqgPXtRrVp
ZrnUKbg9iWjn8jcJHIS7qrIO4GsoFzfhn9gVh8Xxp4AYx0btn3BwPTWCxg53Ie0p
OgrMmMnOe3wrpwrlJOgfvpk5na7yKRt7GYsyGMaKB7OxbHlVg4UCx4LuRBnaUPZr
QmlX37sIR/sEJne0zR4iMorPi5IsErMT39VaBDLnsAjyccbmYQ/RmFYASiM5Zijw
d94fk+TocyDBrOMsO5fzKUID5Uf4c5vJlhCXBsPBykNiKsQTb3M7fZ+gjYrMJmoS
4DDgAMryoB5yc2i9HcNj8WMNHy4RGIrRWxOAUZf5j2zEEVwKaRcoNosFoycUotEA
yoWdRIwyCkVwlemVhx0zQTm8WbtFl0kkAFKTqu7uHGUGOKSS4dzTi000cJ4qHSyY
ODrouvKgqKwB+Q7IfpQ72i6DLpTzNjLKNMipBPsSkSW+RaWC67+smo1vL9V5ZlfX
ypzjMF++r3cRuIWG9IwAwedl/sH7iqjHwdMf4y+8sGxRzW5Oeyvx20TvqxMqRLGD
nU0Y2GCLW7C2Idw+I5QM
=pibq
-----END PGP SIGNATURE-----

View File

@ -158,7 +158,7 @@ index 7ab6be4..022d0ad 100644
+static void
+cut_characters_or_cut_bytes_no_split (FILE *stream)
+{
+ size_t idx; /* number of bytes or characters in the line so far. */
+ uintmax_t idx; /* number of bytes or characters in the line so far. */
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
+ char *bufpos; /* Next read position of BUF. */
+ size_t buflen; /* The length of the byte sequence in buf. */

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.29
Release: 12%{?dist}
Version: 8.30
Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: https://www.gnu.org/software/coreutils/
@ -14,26 +14,6 @@ Source106: coreutils-colorls.csh
# do not make coreutils-single depend on /usr/bin/coreutils
%global __requires_exclude ^%{_bindir}/coreutils$
# mv -n: do not overwrite the destination, superseded by
# http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=v8.29-9-g29baf25aa
Patch1: coreutils-8.29-mv-n-noreplace.patch
# doc: warn about following symlinks recursively in chown/chgrp (CVE-2017-18018)
Patch2: coreutils-8.29-CVE-2017-18018.patch
# fix build failure with glibc-2.28
# https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
Patch3: coreutils-8.29-gnulib-fflush.patch
# fix crash caused by mistakenly enabled leaf optimization (#1558249)
Patch4: coreutils-8.29-fts-leaf-opt.patch
# date, ls: pick strftime fixes from glibc to improve locale support (#1577872)
Patch5: coreutils-8.29-gnulib-strftime.patch
# ls: increase the allowed abmon width from 5 to 12 (#1577872)
Patch6: coreutils-8.29-ls-abmon-width.patch
# disable the test-lock gnulib test prone to deadlock
Patch100: coreutils-8.26-test-lock.patch
@ -269,6 +249,9 @@ fi
%license COPYING
%changelog
* Mon Jul 02 2018 Kamil Dudka <kdudka@redhat.com> - 8.30-1
- new upstream release 8.30
* Wed May 30 2018 Kamil Dudka <kdudka@redhat.com> - 8.29-12
- add provides to coreutils-single to make it a drop-in replacement

View File

@ -1 +1 @@
SHA512 (coreutils-8.29.tar.xz) = 546bbcd5741beae7a68e7c4ca14d6d634f7c8be87feecdeddd00e226f4865bb89d503437c3a95622ba7bb0cb70addbb5bdf3767fa18d0b7410ab90ee53b29dfd
SHA512 (coreutils-8.30.tar.xz) = 25bc132c0d89ce71c33e417f04649c9fcfce6c5ef8b19f093b2e9e2851bfde9b5a31e20499d9c427332228ba54b88d445ddb445551e1944bb8f5cbff5ffa4eda