From 2c2fd97500b0aa953b5ec6a058208f83ecb9d238 Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Sep 03 2009 15:19:58 +0000 Subject: fixed regression where df -l as regular user cause Permission denied (#520630, introduced by fix for rhbz #497830) --- diff --git a/coreutils-7.5-df-localdevice.patch b/coreutils-7.5-df-localdevice.patch new file mode 100644 index 0000000..fb45306 --- /dev/null +++ b/coreutils-7.5-df-localdevice.patch @@ -0,0 +1,17 @@ +diff -urNp coreutils-7.5-orig/src/df.c coreutils-7.5/src/df.c +--- coreutils-7.5-orig/src/df.c 2009-08-15 17:25:32.000000000 +0200 ++++ coreutils-7.5/src/df.c 2009-09-03 16:37:25.000000000 +0200 +@@ -995,7 +995,12 @@ main (int argc, char **argv) + for (i = optind; i < argc; ++i) + { + int fd = open (argv[i], O_RDONLY | O_NOCTTY); +- if (fd < 0 || fstat (fd, &stats[i - optind])) ++ if (0 <= fd && !fstat (fd, &stats[i - optind]) ++ && !stat (argv[i], &stats[i - optind])) ++ { ++ /* open() may have failed for normal user but stat() works */ ++ } ++ else + { + error (0, errno, "%s", quote (argv[i])); + exit_status = EXIT_FAILURE; diff --git a/coreutils.spec b/coreutils.spec index 45e1254..a6b8b08 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 7.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -25,6 +25,7 @@ Patch2: coreutils-7.5-ls-inode.patch Patch100: coreutils-6.10-configuration.patch Patch101: coreutils-6.10-manpages.patch Patch102: coreutils-7.4-sttytcsadrain.patch +Patch103: coreutils-7.5-df-localdevice.patch # sh-utils Patch703: sh-utils-2.0.11-dateman.patch @@ -116,6 +117,7 @@ Libraries for coreutils package. %patch100 -p1 -b .configure %patch101 -p1 -b .manpages %patch102 -p1 -b .tcsadrain +%patch103 -p1 -b .localdevice # sh-utils %patch703 -p1 -b .dateman @@ -331,6 +333,11 @@ fi %{_libdir}/coreutils %changelog +* Thu Sep 03 2009 Ondrej Vasik - 7.5-4 +- fixed regression where df -l as regular user + cause "Permission denied" (#520630, introduced by fix for + rhbz #497830) + * Fri Aug 28 2009 Ondrej Vasik - 7.5-3 - ls -i: print consistent inode numbers also for mount points (#453709)