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:17:52 -0700
User-agent:
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
"Theodoros V. Kalamatianos" <address@hidden> writes:
> I have built coreutils-5.92 on my system (Linux-2.6.11.6/i686,
> glibc-2.3.3CVS) and was testing the build when I came up with a failed
> test for tests/cp/fail-perm. The testsuite is run as root.
> ...
> open("D/a", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY, 0666) = 0
> utimes("/proc/self/fd/0", NULL) = -1 EACCES (Permission denied)
You're saying that you're running as root? So, on your host root
doesn't have the ability to set the time on "/proc/self/fd/0"? That
sounds a bit strange. Root should be able to do anything, right?
Can you reproduce this problem with a small C program? Something like
this. Please run it as root, in the same directory, etc. You can use
strace to verify that it has the same system calls.
#include <fcntl.h>
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
int
main (void)
{
close (0);
if (open ("D/a", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY, 0666) != 0)
perror ("open");
else if (utimes ("/proc/self/fd/0", 0) != 0)
perror ("utimes");
return 0;
}