From 708af6701c419676865367f3bef95cae44b9f3e8 Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Nov 23 2007 11:10:20 +0000 Subject: various fixes from rawhide-details in changelog --- diff --git a/coreutils-6.9-du-ls-upstream.patch b/coreutils-6.9-du-ls-upstream.patch new file mode 100644 index 0000000..e3b0ff9 --- /dev/null +++ b/coreutils-6.9-du-ls-upstream.patch @@ -0,0 +1,88 @@ +Fixes some small bugs (merged upstream patches) +Fixed RedHat Bugzillas: 250089(fix by jplans@redhat.com), 239266 + +diff -Naurp coreutils-5.2.1/lib/fts.c coreutils-5.2.1.new/lib/fts.c +--- coreutils-5.2.1/lib/fts.c 2003-12-20 10:05:23.000000000 -0800 ++++ coreutils-5.2.1.new/lib/fts.c 2007-06-14 11:38:00.696001000 -0700 +@@ -685,7 +685,7 @@ fts_read(sp) + /* If fts_build's call to fts_safe_changedir failed + because it was not able to fchdir into a + subdirectory, tell the caller. */ +- if (p->fts_errno) ++ if (p->fts_errno && p->fts_info != FTS_DNR) + p->fts_info = FTS_ERR; + LEAVE_DIR (sp, p, "2"); + return (p); + } +diff -ur coreutils-6.9-orig/src/du.c coreutils-6.9/src/du.c +--- coreutils-6.9-orig/src/du.c ++++ coreutils-6.9/src/du.c + duinfo_add (&dulvl[level].ent, &dui); + + /* Even if this directory is unreadable or we can't chdir into it, +- do let its size contribute to the total, ... */ ++ do let its size contribute to the total. */ + duinfo_add (&tot_dui, &dui); + +- /* ... but don't print out a total for it, since without the size(s) +- of any potential entries, it could be very misleading. */ +- if (ent->fts_info == FTS_DNR) +- return ok; +- + /* If we're not counting an entry, e.g., because it's a hard link + to a file we've already counted (and --count-links), then don't + print a line for it. */ +diff -urNp coreutils-6.9-orig/src/dircolors.hin coreutils-6.9/src/dircolors.hin +--- coreutils-6.9-orig/src/dircolors.hin 2007-03-18 22:36:43.000000000 +0100 ++++ coreutils-6.9/src/dircolors.hin 2007-11-02 12:27:03.000000000 +0100 +@@ -27,6 +27,7 @@ TERM cons25 + TERM console + TERM cygwin + TERM dtterm ++TERM eterm-color + TERM gnome + TERM konsole + TERM kterm +@@ -40,6 +40,7 @@ TERM rxvt-cygwin + TERM rxvt-cygwin-native + TERM rxvt-unicode + TERM screen ++TERM screen-256color + TERM screen-bce + TERM screen-w + TERM screen.linux +@@ -46,7 +47,9 @@ TERM screen-w + TERM screen.linux + TERM vt100 + TERM xterm ++TERM xterm-16color + TERM xterm-256color ++TERM xterm-88color + TERM xterm-color + TERM xterm-debian + +diff -ur a/src/ls.c b/src/ls.c +--- a/src/ls.c ++++ b/src/ls.c +@@ -1168,7 +1168,7 @@ main (int argc, char **argv) + { + /* Avoid following symbolic links when possible. */ + if (is_colored (C_ORPHAN) +- || is_colored (C_EXEC) ++ || (is_colored (C_EXEC) && color_symlink_as_referent) + || (is_colored (C_MISSING) && format == long_format)) + check_symlink_color = true; + +@@ -2713,6 +2713,12 @@ gobble_file (char const *name, enum filetype type, ino_t inode, + free (linkname); + } + ++ /* When not distinguishing types of symlinks, pretend we know that ++ it is stat'able, so that it will be colored as a regular symlink, ++ and not as an orphan. */ ++ if (S_ISLNK (f->stat.st_mode) && !check_symlink_color) ++ f->linkok = true; ++ + if (S_ISLNK (f->stat.st_mode)) + f->filetype = symbolic_link; + else if (S_ISDIR (f->stat.st_mode)) diff --git a/coreutils-getdateYYYYMMDD.patch b/coreutils-getdateYYYYMMDD.patch new file mode 100644 index 0000000..63cd449 --- /dev/null +++ b/coreutils-getdateYYYYMMDD.patch @@ -0,0 +1,124 @@ +diff -urNp coreutils-6.9.orig/lib/getdate.y coreutils-6.9/lib/getdate.y +--- coreutils-6.9.orig/lib/getdate.y 2007-02-23 19:25:21.000000000 +0100 ++++ coreutils-6.9/lib/getdate.y 2007-11-23 10:27:13.000000000 +0100 +@@ -199,6 +199,42 @@ static int yylex (union YYSTYPE *, parse + static int yyerror (parser_control const *, char const *); + static long int time_zone_hhmm (textint, long int); + ++static void ++digits_to_date_time (parser_control *pc, textint text_int) ++{ ++ if (pc->dates_seen && ! pc->year.digits ++ && ! pc->rels_seen && (pc->times_seen || 2 < text_int.digits)) ++ pc->year = text_int; ++ else ++ { ++ if (4 < text_int.digits) ++ { ++ pc->dates_seen++; ++ pc->day = text_int.value % 100; ++ pc->month = (text_int.value / 100) % 100; ++ pc->year.value = text_int.value / 10000; ++ pc->year.digits = text_int.digits - 4; ++ } ++ else ++ { ++ pc->times_seen++; ++ if (text_int.digits <= 2) ++ { ++ pc->hour = text_int.value; ++ pc->minutes = 0; ++ } ++ else ++ { ++ pc->hour = text_int.value / 100; ++ pc->minutes = text_int.value % 100; ++ } ++ pc->seconds.tv_sec = 0; ++ pc->seconds.tv_nsec = 0; ++ pc->meridian = MER24; ++ } ++ } ++} ++ + %} + + /* We want a reentrant parser, even if the TZ manipulation and the calls to +@@ -268,6 +304,7 @@ item: + | rel + { pc->rels_seen = true; } + | number ++ | hybrid + ; + + time: +@@ -543,38 +580,23 @@ unsigned_seconds: + + number: + tUNUMBER ++ { digits_to_date_time (pc, $1); } ++ ; ++ ++hybrid: ++ tUNUMBER relunit_snumber + { +- if (pc->dates_seen && ! pc->year.digits +- && ! pc->rels_seen && (pc->times_seen || 2 < $1.digits)) +- pc->year = $1; +- else +- { +- if (4 < $1.digits) +- { +- pc->dates_seen++; +- pc->day = $1.value % 100; +- pc->month = ($1.value / 100) % 100; +- pc->year.value = $1.value / 10000; +- pc->year.digits = $1.digits - 4; +- } +- else +- { +- pc->times_seen++; +- if ($1.digits <= 2) +- { +- pc->hour = $1.value; +- pc->minutes = 0; +- } +- else +- { +- pc->hour = $1.value / 100; +- pc->minutes = $1.value % 100; +- } +- pc->seconds.tv_sec = 0; +- pc->seconds.tv_nsec = 0; +- pc->meridian = MER24; +- } +- } ++ /* Hybrid all-digit and relative offset, so that we accept e.g., ++ "YYYYMMDD +N days" as well as "YYYYMMDD N days". */ ++ digits_to_date_time (pc, $1); ++ pc->rel.ns += $2.ns; ++ pc->rel.seconds += $2.seconds; ++ pc->rel.minutes += $2.minutes; ++ pc->rel.hour += $2.hour; ++ pc->rel.day += $2.day; ++ pc->rel.month += $2.month; ++ pc->rel.year += $2.year; ++ pc->rels_seen = true; + } + ; + +diff -urNp coreutils-6.9.orig/tests/misc/date coreutils-6.9/tests/misc/date +--- coreutils-6.9.orig/tests/misc/date 2007-03-18 22:36:43.000000000 +0100 ++++ coreutils-6.9/tests/misc/date 2007-11-23 10:14:19.000000000 +0100 +@@ -135,6 +135,11 @@ my @Tests = + ['next-mo', "-d '$d1 next month' '+%Y-%m-%d %T'", {OUT=>"$dm $t0"}], + ['next-y', "-d '$d1 next year' '+%Y-%m-%d %T'", {OUT=>"$dy $t0"}], + ++ # This has always worked, ... ++ ['rel-1', "-d '20050101 1 day' +%F", {OUT=>"2005-01-02"}], ++ # ...but up to coreutils-6.9, this was rejected due to the "+". ++ ['rel-1p', "-d '20050101 +1 day' +%F", {OUT=>"2005-01-02"}], ++ + ['utc-0', "-u -d '08/01/97 6:00' '+%D,%H:%M'", {OUT=>"08/01/97,06:00"}, + {ENV => 'TZ=UTC+4'}], + diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index baba88a..c221d1e 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -2223,18 +2223,32 @@ +#endif case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); - default: -@@ -523,6 +613,10 @@ + default: +@@ -503,6 +591,7 @@ + static bool + change_attributes (char const *name) + { ++ bool ok = false; + /* chown must precede chmod because on some systems, + chown clears the set[ug]id bits for non-superusers, + resulting in incorrect permissions. +@@ -521,9 +610,14 @@ + else if (chmod (name, mode) != 0) + error (0, errno, _("cannot change permissions of %s"), quote (name)); else - return true; - +- return true; ++ ok = true; ++ +#ifdef WITH_SELINUX + if (use_default_selinux_context) -+ setdefaultfilecon(name); ++ setdefaultfilecon (name); +#endif - return false; + +- return false; ++ return ok; } + /* Set the timestamps of file TO to match those of file FROM. @@ -687,6 +781,11 @@ -T, --no-target-directory treat DEST as a normal file\n\ -v, --verbose print the name of each directory as it is created\n\ diff --git a/coreutils.spec b/coreutils.spec index 553f3fa..ae662a3 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: The GNU core utilities: a set of tools commonly used in shell scripts Name: coreutils Version: 6.9 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -20,9 +20,11 @@ Source203: coreutils-runuser-l.pamd Patch1: coreutils-futimens.patch Patch2: coreutils-ls-x.patch Patch3: coreutils-6.9-cp-i-u.patch +Patch4: coreutils-6.9-du-ls-upstream.patch # Our patches Patch100: coreutils-chgrp.patch +Patch101: coreutils-getdateYYYYMMDD.patch # sh-utils Patch703: sh-utils-2.0.11-dateman.patch @@ -89,9 +91,11 @@ the old GNU fileutils, sh-utils, and textutils packages. %patch1 -p1 -b .futimens %patch2 -p1 -b .ls-x %patch3 -p1 -b .cp-i-u +%patch4 -p1 -b .du-ls # Our patches %patch100 -p1 -b .chgrp +%patch101 -p1 -b .getdate # sh-utils %patch703 -p1 -b .dateman @@ -285,6 +289,15 @@ fi /sbin/runuser %changelog +* Fri Nov 23 2007 Ondrej Vasik - 6.9-10 +- fixed bug in handling YYYYMMDD date format with relative + signed offset(#377821) +- fixed bug in selinux patch which caused bad preserving + of security context in install(#319231) +- added some upstream supported dircolors TERMs(#239266) +- fixed du output for unaccesible dirs(#250089) +- a bit of upstream tunning for symlinks + * Tue Oct 30 2007 Ondrej Vasik - 6.9-9 - applied upstream patch for runuser to coreutils-selinux.patch(#232652) - modified coreutils-i18n.patch because of sort -R in