public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tst-faccessat.c if run as root
@ 2006-01-15 20:14 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-01-15 20:14 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-15 20:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-15 20:14 [PATCH] Fix tst-faccessat.c if run as root Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).