[PATCH] Fix tst-faccessat.c if run as root
Jakub Jelinek
jakub@redhat.com
Sun Jan 15 20:14:00 GMT 2006
Hi!
While it is generally a bad idea to run glibc testsuite as root (and I
usually don't do that either), other tests test for this condition too.
2006-01-15 Jakub Jelinek <jakub@redhat.com>
* io/tst-faccessat.c (do_test): Don't fail if getuid () == 0.
--- libc/io/tst-faccessat.c.jj 2006-01-06 13:14:18.000000000 +0100
+++ libc/io/tst-faccessat.c 2006-01-15 21:10:20.000000000 +0100
@@ -134,8 +134,9 @@ do_test (void)
}
errno = 0;
- if (faccessat (dir_fd, "some-file", W_OK, AT_EACCESS) == 0
- || errno != EACCES)
+ if (getuid () != 0
+ && (faccessat (dir_fd, "some-file", W_OK, AT_EACCESS) == 0
+ || errno != EACCES))
{
printf ("faccessat W_OK on unwritable file: %m\n");
result = 1;
Jakub
More information about the Libc-hacker
mailing list