rpms/coreutils/FC-5 coreutils-proc.patch, NONE, 1.1 coreutils.spec, 1.109, 1.110

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue May 16 15:29:32 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/coreutils/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv25417

Modified Files:
	coreutils.spec 
Added Files:
	coreutils-proc.patch 
Log Message:
* Tue May 16 2006 Tim Waugh <twaugh at redhat.com>
- Upstream patch to fix cp -p when proc is not mounted (bug #190601).


coreutils-proc.patch:
 utimens.c |   52 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 23 deletions(-)

--- NEW FILE coreutils-proc.patch ---
===================================================================
RCS file: /sources/coreutils/coreutils/lib/utimens.c,v
rcsdiff: /sources/coreutils/coreutils/lib/utimens.c,v: warning: Unknown phrases like `commitid ...;' are present.
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- coreutils/lib/utimens.c	2005/10/30 21:32:02	1.11
+++ coreutils/lib/utimens.c	2006/04/15 07:39:46	1.12
@@ -1,4 +1,6 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Set file access and modification times.
+
+   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -91,34 +93,40 @@
   else
     t = NULL;
 
+
+  if (fd < 0)
+    {
 # if HAVE_FUTIMESAT
-  return fd < 0 ? futimesat (AT_FDCWD, file, t) : futimesat (fd, NULL, t);
-# elif HAVE_FUTIMES
-  if (0 <= fd)
+      return futimesat (AT_FDCWD, file, t);
+# endif
+    }
+  else
     {
+      /* If futimesat or futimes fails here, don't try to speed things
+	 up by returning right away.  glibc can incorrectly fail with
+	 errno == ENOENT if /proc isn't mounted.  Also, Mandrake 10.0
+	 in high security mode doesn't allow ordinary users to read
+	 /proc/self, so glibc incorrectly fails with errno == EACCES.
+	 If errno == EIO, EPERM, or EROFS, it's probably safe to fail
+	 right away, but these cases are rare enough that they're not
+	 worth optimizing, and who knows what other messed-up systems
+	 are out there?  So play it safe and fall back on the code
+	 below.  */
+# if HAVE_FUTIMESAT
+      if (futimesat (fd, NULL, t) == 0)
+	return 0;
+# elif HAVE_FUTIMES
       if (futimes (fd, t) == 0)
 	return 0;
-
-      /* Don't worry about trying to speed things up by returning right
-	 away here.  glibc futimes can incorrectly fail with errno ==
-	 ENOENT if /proc isn't mounted.  Also, Mandrake 10.0 in high
-	 security mode doesn't allow ordinary users to read /proc/self, so
-	 glibc futimes incorrectly fails with errno == EACCES.  If futimes
-	 fails with errno == EIO, EPERM, or EROFS, it's probably safe to
-	 fail right away, but these cases are rare enough that they're not
-	 worth optimizing, and who knows what other messed-up systems are
-	 out there?  So play it safe and fall back on the code below.  */
-    }
 # endif
+    }
 #endif
 
-#if ! HAVE_FUTIMESAT
-
   if (!file)
     {
-# if ! (HAVE_WORKING_UTIMES && HAVE_FUTIMES)
+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
       errno = ENOSYS;
-# endif
+#endif
 
       /* Prefer EBADF to ENOSYS if both error numbers apply.  */
       if (errno == ENOSYS)
@@ -133,9 +141,9 @@
       return -1;
     }
 
-# if HAVE_WORKING_UTIMES
+#if HAVE_WORKING_UTIMES
   return utimes (file, t);
-# else
+#else
   {
     struct utimbuf utimbuf;
     struct utimbuf const *ut;
@@ -150,8 +158,6 @@
 
     return utime (file, ut);
   }
-# endif
-
 #endif
 }
 


Index: coreutils.spec
===================================================================
RCS file: /cvs/dist/rpms/coreutils/FC-5/coreutils.spec,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- coreutils.spec	15 May 2006 12:50:13 -0000	1.109
+++ coreutils.spec	16 May 2006 15:29:29 -0000	1.110
@@ -41,6 +41,7 @@
 Patch908: coreutils-getgrouplist.patch
 Patch912: coreutils-overflow.patch
 Patch913: coreutils-afs.patch
+Patch915: coreutils-proc.patch
 
 #SELINUX Patch
 Patch950: coreutils-selinux.patch
@@ -93,6 +94,7 @@
 %patch908 -p1 -b .getgrouplist
 %patch912 -p1 -b .overflow
 %patch913 -p1 -b .afs
+%patch915 -p1 -b .proc
 
 #SELinux
 %patch950 -p1 -b .selinux
@@ -261,6 +263,9 @@
 /sbin/runuser
 
 %changelog
+* Tue May 16 2006 Tim Waugh <twaugh at redhat.com>
+- Upstream patch to fix cp -p when proc is not mounted (bug #190601).
+
 * Mon May 15 2006 Tim Waugh <twaugh at redhat.com> 5.95-1.1
 - 5.95.
 - Updated selinux patch.




More information about the fedora-cvs-commits mailing list