New upstream release 8.0 (beta), defuzz patches, remove applied patches

This commit is contained in:
Ondrej Vasik 2009-10-06 13:43:25 +00:00
parent fa0337b2a5
commit 207519174e
10 changed files with 15 additions and 360 deletions

View File

@ -1 +1 @@
coreutils-7.6.tar.xz
coreutils-8.0.tar.xz

View File

@ -105,18 +105,14 @@ diff -urNp coreutils-7.0.orig/src/su.c coreutils-7.0/src/su.c
#if HAVE_PATHS_H
# include <paths.h>
@@ -149,6 +155,10 @@
@@ -149,11 +155,18 @@
#ifndef USE_PAM
char *crypt (char const *key, char const *salt);
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
+
char *getusershell (void);
void endusershell (void);
void setusershell (void);
@@ -156,7 +166,11 @@ void setusershell ();
extern char **environ;
static void run_shell (char const *, char const *, char **, size_t,

View File

@ -1,11 +0,0 @@
diff -urNp coreutils-7.6-orig/src/dircolors.hin coreutils-7.6/src/dircolors.hin
--- coreutils-7.6-orig/src/dircolors.hin 2009-09-01 13:01:16.000000000 +0200
+++ coreutils-7.6/src/dircolors.hin 2009-09-21 08:00:38.000000000 +0200
@@ -131,6 +131,7 @@ EXEC 01;32
.cpio 01;31
.7z 01;31
.rz 01;31
+.lz 01;31
# image formats
.jpg 01;35

View File

@ -1,163 +0,0 @@
From cca83fafa69eb26db458714830b77498b88af8a4 Mon Sep 17 00:00:00 2001
From: Ondřej Vašík <ovasik@redhat.com>
Date: Mon, 14 Sep 2009 13:12:01 +0000
Subject: cp,mv: preserve extended attributes even for read-only files
* src/copy.c (copy_reg): Temporarily set u+rw on the destination file
to allow GNU/Linux to set xattrs.
* tests/misc/xattr: Test that change.
Reported by Ernest N. Mamikonyan.
---
diff --git a/src/copy.c b/src/copy.c
index f3ff5a2..ad2060b 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -834,6 +834,24 @@ copy_reg (char const *src_name, char const *dst_name,
}
}
+ /* To allow copying xattrs on read-only files, temporarily chmod u+rw.
+ This workaround is required as an inode permission check is done
+ by xattr_permission() in fs/xattr.c of the GNU/Linux kernel tree. */
+ if (x->preserve_xattr)
+ {
+ bool access_changed = false;
+
+ if (!(sb.st_mode & S_IWUSR) && geteuid() != 0)
+ access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;
+
+ if (!copy_attr_by_fd (src_name, source_desc, dst_name, dest_desc, x)
+ && x->require_preserve_xattr)
+ return_val = false;
+
+ if (access_changed)
+ fchmod_or_lchmod (dest_desc, dst_name, dst_mode & ~omitted_permissions);
+ }
+
if (x->preserve_ownership && ! SAME_OWNER_AND_GROUP (*src_sb, sb))
{
switch (set_owner (x, dst_name, dest_desc, src_sb, *new_dst, &sb))
@@ -850,11 +868,6 @@ copy_reg (char const *src_name, char const *dst_name,
set_author (dst_name, dest_desc, src_sb);
- if (x->preserve_xattr && ! copy_attr_by_fd (src_name, source_desc,
- dst_name, dest_desc, x)
- && x->require_preserve_xattr)
- return_val = false;
-
if (x->preserve_mode || x->move_mode)
{
if (copy_acl (src_name, source_desc, dst_name, dest_desc, src_mode) != 0
diff --git a/tests/misc/xattr b/tests/misc/xattr
index a27e1f6..fcf7ceb 100755
--- a/tests/misc/xattr
+++ b/tests/misc/xattr
@@ -29,7 +29,7 @@ fi
# Skip this test if cp was built without xattr support:
touch src dest || framework_failure
-cp --preserve=xattr -n src dest 2>/dev/null \
+cp --preserve=xattr -n src dest \
|| skip_test_ "coreutils built without xattr support"
# this code was taken from test mv/backup-is-src
@@ -46,13 +46,13 @@ xattr_pair="$xattr_name=\"$xattr_value\""
# create new file and check its xattrs
touch a || framework_failure
getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_a >/dev/null && framework_failure
+grep -F "$xattr_pair" out_a && framework_failure
# try to set user xattr on file
setfattr -n "$xattr_name" -v "$xattr_value" a >out_a \
|| skip_test_ "failed to set xattr of file"
getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_a >/dev/null \
+grep -F "$xattr_pair" out_a \
|| skip_test_ "failed to set xattr of file"
fail=0
@@ -60,36 +60,50 @@ fail=0
# cp should not preserve xattr by default
cp a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_b >/dev/null && fail=1
+grep -F "$xattr_pair" out_b && fail=1
# test if --preserve=xattr option works
cp --preserve=xattr a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_b >/dev/null || fail=1
+grep -F "$xattr_pair" out_b || fail=1
#test if --preserve=all option works
cp --preserve=all a c || fail=1
getfattr -d c >out_c || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_c >/dev/null || fail=1
+grep -F "$xattr_pair" out_c || fail=1
#test if -a option works without any diagnostics
cp -a a d 2>err && test -s err && fail=1
getfattr -d d >out_d || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_d >/dev/null || fail=1
+grep -F "$xattr_pair" out_d || fail=1
+
+#test if --preserve=xattr works even for files without write access
+chmod a-w a || framework_failure
+rm -f e
+cp --preserve=xattr a e || fail=1
+getfattr -d e >out_e || skip_test_ "failed to get xattr of file"
+grep -F "$xattr_pair" out_e || fail=1
+
+#Ensure that permission bits are preserved, too.
+src_perm=$(stat --format=%a a)
+dst_perm=$(stat --format=%a e)
+test "$dst_perm" = "$src_perm" || fail=1
+
+chmod u+w a || framework_failure
rm b || framework_failure
# install should never preserve xattr
ginstall a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_b >/dev/null && fail=1
+grep -F "$xattr_pair" out_b && fail=1
# mv should preserve xattr when renaming within a file system.
# This is implicitly done by rename () and doesn't need explicit
# xattr support in mv.
mv a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_b >/dev/null || cat >&2 <<EOF
+grep -F "$xattr_pair" out_b || cat >&2 <<EOF
=================================================================
$0: WARNING!!!
rename () does not preserve extended attributes
@@ -99,18 +113,18 @@ EOF
# try to set user xattr on file on other partition
test_mv=1
touch "$b_other" || framework_failure
-setfattr -n "$xattr_name" -v "$xattr_value" "$b_other" >out_a 2>/dev/null \
+setfattr -n "$xattr_name" -v "$xattr_value" "$b_other" >out_a \
|| test_mv=0
-getfattr -d "$b_other" >out_b 2>/dev/null || test_mv=0
-grep -F "$xattr_pair" out_b >/dev/null || test_mv=0
+getfattr -d "$b_other" >out_b || test_mv=0
+grep -F "$xattr_pair" out_b || test_mv=0
rm -f "$b_other" || framework_failure
if test $test_mv -eq 1; then
# mv should preserve xattr when copying content from one partition to another
mv b "$b_other" || fail=1
- getfattr -d "$b_other" >out_b 2>/dev/null ||
+ getfattr -d "$b_other" >out_b ||
skip_test_ "failed to get xattr of file"
- grep -F "$xattr_pair" out_b >/dev/null || fail=1
+ grep -F "$xattr_pair" out_b || fail=1
else
cat >&2 <<EOF
=================================================================
--
cgit v0.8.2.1

View File

@ -346,7 +346,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
error (EXIT_FAILURE, errno, "-");
--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000
+++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000
@@ -23,16 +23,30 @@
@@ -23,17 +23,31 @@
#include <sys/types.h>
#include <getopt.h>
@ -362,6 +362,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+
#include "system.h"
#include "error.h"
#include "hard-locale.h"
#include "linebuffer.h"
-#include "memcasecmp.h"
#include "quote.h"

View File

@ -1,161 +0,0 @@
diff -urNp coreutils-7.6-orig/doc/coreutils.texi coreutils-7.6/doc/coreutils.texi
--- coreutils-7.6-orig/doc/coreutils.texi 2009-09-22 15:12:55.000000000 +0200
+++ coreutils-7.6/doc/coreutils.texi 2009-10-02 16:09:57.000000000 +0200
@@ -6114,7 +6114,8 @@ Exit status:
specified as a command line argument. This happens when listing a
directory in which entries are actively being removed or renamed.)
2 serious trouble (e.g., memory exhausted, invalid option or failure
- to access file or directory specified as a command line argument)
+ to access file or directory specified as a command line argument
+ or a directory loop)
@end display
Also see @ref{Common options}.
diff -urNp coreutils-7.6-orig/src/ls.c coreutils-7.6/src/ls.c
--- coreutils-7.6-orig/src/ls.c 2009-09-22 15:12:55.000000000 +0200
+++ coreutils-7.6/src/ls.c 2009-10-02 16:19:54.000000000 +0200
@@ -2494,6 +2494,7 @@ print_dir (char const *name, char const
error (0, 0, _("%s: not listing already-listed directory"),
quotearg_colon (name));
closedir (dirp);
+ set_exit_status (true);
return;
}
@@ -3582,6 +3583,18 @@ format_user_width (uid_t u)
return format_user_or_group_width (numeric_ids ? NULL : getuser (u), u);
}
+/* Return a pointer to a formatted version of F->stat.st_ino,
+ possibly using buffer, BUF, of length BUFLEN, which must be at least
+ INT_BUFSIZE_BOUND (uintmax_t) bytes. */
+static char *
+format_inode (char *buf, size_t buflen, const struct fileinfo *f)
+{
+ assert (INT_BUFSIZE_BOUND (uintmax_t) <= buflen);
+ return (f->stat_ok && f->stat.st_ino != NOT_AN_INODE_NUMBER
+ ? umaxtostr (f->stat.st_ino, buf)
+ : (char *) "?");
+}
+
/* Likewise, for groups. */
static int
@@ -3712,9 +3725,7 @@ print_long_format (const struct fileinfo
{
char hbuf[INT_BUFSIZE_BOUND (uintmax_t)];
sprintf (p, "%*s ", inode_number_width,
- (f->stat.st_ino == NOT_AN_INODE_NUMBER
- ? "?"
- : umaxtostr (f->stat.st_ino, hbuf)));
+ format_inode (hbuf, sizeof hbuf, f));
/* Increment by strlen (p) here, rather than by inode_number_width + 1.
The latter is wrong when inode_number_width is zero. */
p += strlen (p);
@@ -4104,12 +4115,13 @@ print_file_name_and_frills (const struct
if (print_inode)
printf ("%*s ", format == with_commas ? 0 : inode_number_width,
- umaxtostr (f->stat.st_ino, buf));
+ format_inode (buf, sizeof buf, f));
if (print_block_size)
printf ("%*s ", format == with_commas ? 0 : block_size_width,
- human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts,
- ST_NBLOCKSIZE, output_block_size));
+ ! f->stat_ok ? "?"
+ : human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts,
+ ST_NBLOCKSIZE, output_block_size));
size_t width = print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f),
f->linkok, f->stat_ok, f->filetype,
@@ -4320,9 +4332,10 @@ length_of_file_name_and_frills (const st
if (print_block_size)
len += 1 + (format == with_commas
- ? strlen (human_readable (ST_NBLOCKS (f->stat), buf,
- human_output_opts, ST_NBLOCKSIZE,
- output_block_size))
+ ? strlen (! f->stat_ok ? "?"
+ : human_readable (ST_NBLOCKS (f->stat), buf,
+ human_output_opts, ST_NBLOCKSIZE,
+ output_block_size))
: block_size_width);
quote_name (NULL, f->name, filename_quoting_options, &name_width);
diff -urNp coreutils-7.6-orig/tests/ls/dangle coreutils-7.6/tests/ls/dangle
--- coreutils-7.6-orig/tests/ls/dangle 2009-09-01 13:01:16.000000000 +0200
+++ coreutils-7.6/tests/ls/dangle 2009-10-02 16:21:06.000000000 +0200
@@ -26,6 +26,10 @@ fi
ln -s no-such-file dangle || framework_failure
mkdir -p dir/sub || framework_failure
ln -s dir slink-to-dir || framework_failure
+mkdir d || framework_failure
+ln -s no-such d/dangle || framework_failure
+printf '? dangle\n' > subdir_Li_exp || framework_failure
+printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure
fail=0
@@ -50,4 +54,14 @@ EOF
compare out exp || fail=1
+# Ensure that ls -Li prints "?" as the inode of a dangling symlink.
+rm -f out
+ls -Li d > out 2>/dev/null && fail=1
+compare out subdir_Li_exp || fail=1
+
+# Ensure that ls -Ls prints "?" as the allocation of a dangling symlink.
+rm -f out
+ls -Ls d > out 2>/dev/null && fail=1
+compare out subdir_Ls_exp || fail=1
+
Exit $fail
diff -urNp coreutils-7.6-orig/tests/ls/infloop coreutils-7.6/tests/ls/infloop
--- coreutils-7.6-orig/tests/ls/infloop 2009-09-01 13:01:16.000000000 +0200
+++ coreutils-7.6/tests/ls/infloop 2009-10-02 16:12:11.000000000 +0200
@@ -1,6 +1,7 @@
#!/bin/sh
# show that the following no longer makes ls infloop
# mkdir loop; cd loop; ln -s ../loop sub; ls -RL
+# Also ensure ls exits with status = 2 in that case.
# Copyright (C) 2001-2002, 2004, 2006-2009 Free Software Foundation, Inc.
@@ -27,21 +28,22 @@ fi
mkdir loop || framework_failure
ln -s ../loop loop/sub || framework_failure
-fail=0
-
-ls -RL loop 2>err | head -n 7 > out
-# With an inf-looping ls, out will contain these 7 lines:
-cat <<EOF > bad
+cat <<\EOF > exp-out || framework_failure
loop:
sub
+EOF
-loop/sub:
-sub
-
-loop/sub/sub:
+cat <<\EOF > exp-err || framework_failure
+ls: loop/sub: not listing already-listed directory
EOF
-# Make sure we don't get the "bad" output.
-compare out bad > /dev/null 2>&1 && fail=1
+fail=0
+
+timeout 1 ls -RL loop 2>err > out
+# Ensure that ls exits with status 2 upon detecting a cycle
+test $? = 2 || fail=1
+
+compare err exp-err || fail=1
+compare out exp-out || fail=1
Exit $fail

View File

@ -44,16 +44,13 @@
#include "system.h"
#include "getpass.h"
@@ -128,15 +147,22 @@
@@ -128,12 +147,19 @@
/* The user to become if none is specified. */
#define DEFAULT_USER "root"
+#ifndef USE_PAM
char *crypt (char const *key, char const *salt);
+#endif
char *getusershell (void);
void endusershell (void);
void setusershell (void);
extern char **environ;

View File

@ -557,8 +557,8 @@ diff -urNp coreutils-7.1-orig/src/ls.c coreutils-7.1/src/ls.c
+
DIRED_INDENT ();
- if (print_owner | print_group | print_author | print_scontext)
+ if (print_owner | print_group | print_author)
- if (print_owner || print_group || print_author || print_scontext)
+ if (print_owner || print_group || print_author)
{
DIRED_FPUTS (buf, stdout, p - buf);

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 7.6
Release: 7%{?dist}
Version: 8.0
Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -18,9 +18,6 @@ Source202: coreutils-su-l.pamd
Source203: coreutils-runuser-l.pamd
# From upstream
Patch1: coreutils-cpxattrreadonly.patch
Patch2: coreutils-7.6-lzipcolor.patch
Patch3: coreutils-ls-inode.patch
# Our patches
Patch100: coreutils-6.10-configuration.patch
@ -110,8 +107,6 @@ Libraries for coreutils package.
%setup -q
# From upstream
%patch1 -p1 -b .roxattr
%patch2 -p1 -b .lzip
# Our patches
%patch100 -p1 -b .configure
@ -139,9 +134,6 @@ Libraries for coreutils package.
%patch950 -p1 -b .selinux
%patch951 -p1 -b .selinuxman
#apply upstream patch later to prevent defuzzing
%patch3 -p1 -b .inode
chmod a+x tests/misc/sort-mb-tests
#fix typos/mistakes in localized documentation(#439410, #440056)
@ -333,6 +325,10 @@ fi
%{_libdir}/coreutils
%changelog
* Wed Oct 07 2009 Ondrej Vasik <ovasik@redhat.com> - 8.0-1
- New upstream release 8.0 (beta), defuzz patches,
remove applied patches
* Mon Oct 05 2009 Ondrej Vasik <ovasik@redhat.com> - 7.6-7
- chcon no longer aborts on a selinux disabled system
(#527142)

View File

@ -1 +1 @@
a9fb9368e40205d70fc37b9fe441e8ec coreutils-7.6.tar.xz
fe3bb9376150acb5af4a2a280d6fd91a coreutils-8.0.tar.xz