rpms/coreutils/devel coreutils-proc.patch, NONE, 1.1 coreutils.spec, 1.115, 1.116
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue May 16 15:28:15 UTC 2006
Author: twaugh
Update of /cvs/dist/rpms/coreutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv24885
Modified Files:
coreutils.spec
Added Files:
coreutils-proc.patch
Log Message:
- 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/devel/coreutils.spec,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- coreutils.spec 16 May 2006 15:14:26 -0000 1.115
+++ coreutils.spec 16 May 2006 15:28:13 -0000 1.116
@@ -43,6 +43,7 @@
Patch912: coreutils-overflow.patch
Patch913: coreutils-afs.patch
Patch914: coreutils-tee.patch
+Patch915: coreutils-proc.patch
#SELINUX Patch
Patch950: coreutils-selinux.patch
@@ -96,6 +97,7 @@
%patch912 -p1 -b .overflow
%patch913 -p1 -b .afs
%patch914 -p1 -b .tee
+%patch915 -p1 -b .proc
#SELinux
%patch950 -p1 -b .selinux
@@ -265,6 +267,7 @@
%changelog
* Tue May 16 2006 Tim Waugh <twaugh at redhat.com> 5.95-3
+- Upstream patch to fix cp -p when proc is not mounted (bug #190601).
- BuildRequires libacl-devel.
* Mon May 15 2006 Tim Waugh <twaugh at redhat.com>
More information about the fedora-cvs-commits
mailing list