bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-5.92 - tests/cp/fail-perm fails when run as root


From: Paul Eggert
Subject: Re: coreutils-5.92 - tests/cp/fail-perm fails when run as root
Date: Sun, 30 Oct 2005 01:46:05 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

"Theodoros V. Kalamatianos" <address@hidden> writes:

> It seems that my distribution (Mandrake 10.1) in the high security
> mode restricts access to /proc,

Thanks for tracking that down.  Does the following patch fix things
for you?

2005-10-30  Paul Eggert  <address@hidden>

        * lib/utimens.c (futimens) [HAVE_WORKING_UTIMES &&
        HAVE_FUTIMES]: Don't assume that futimes failing with errno ==
        EACCES means we must fail.  With /proc mounted, paranoid
        distributions like Mandrake 10.1 in high security mode don't
        allow ordinary users to read /proc, so futimes fails with
        errno == EACCES.  Problem reported by Theodoros
        V. Kalamatianos.

--- lib/utimens.c.~1.10.~       2005-09-26 15:15:28.000000000 -0700
+++ lib/utimens.c       2005-10-30 01:45:21.000000000 -0800
@@ -100,11 +100,13 @@ futimens (int fd ATTRIBUTE_UNUSED,
        return 0;
 
       /* On GNU/Linux without the futimes syscall and without /proc
-        mounted, glibc futimes fails with errno == ENOENT.  Fall back
-        on utimes if we get a weird error number like that.  */
+        mounted, glibc futimes fails with errno == ENOENT.  And with
+        /proc mounted, some paranoid distributions don't allow
+        ordinary users to read /proc, so futimes fails with errno ==
+        EACCES.  Fall back on utimes if we get an error number like
+        that.  */
       switch (errno)
        {
-       case EACCES:
        case EIO:
        case EPERM:
        case EROFS:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]