rpms/coreutils/devel coreutils-7.5-df-localdevice.patch, NONE, 1.1 coreutils.spec, 1.270, 1.271

Ondrej Vasik ovasik at fedoraproject.org
Thu Sep 3 15:19:58 UTC 2009


Author: ovasik

Update of /cvs/extras/rpms/coreutils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15748

Modified Files:
	coreutils.spec 
Added Files:
	coreutils-7.5-df-localdevice.patch 
Log Message:
fixed regression where df -l <device> as regular user cause Permission denied (#520630, introduced by fix for rhbz #497830)

coreutils-7.5-df-localdevice.patch:
 df.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- NEW FILE coreutils-7.5-df-localdevice.patch ---
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;


Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/devel/coreutils.spec,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -p -r1.270 -r1.271
--- coreutils.spec	1 Sep 2009 10:05:36 -0000	1.270
+++ coreutils.spec	3 Sep 2009 15:19:58 -0000	1.271
@@ -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 <ovasik at redhat.com> - 7.5-4
+- fixed regression where df -l <device> as regular user
+  cause "Permission denied" (#520630, introduced by fix for
+  rhbz #497830)
+
 * Fri Aug 28 2009 Ondrej Vasik <ovasik at redhat.com> - 7.5-3
 - ls -i: print consistent inode numbers also for mount points
   (#453709)




More information about the fedora-extras-commits mailing list