From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27877 invoked by alias); 15 Jan 2006 20:14:56 -0000 Received: (qmail 27855 invoked by uid 22791); 15 Jan 2006 20:14:55 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 15 Jan 2006 20:14:53 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k0FKEhPQ007372; Sun, 15 Jan 2006 21:14:43 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k0FKEgI6007371; Sun, 15 Jan 2006 21:14:42 +0100 Date: Sun, 15 Jan 2006 20:14:00 -0000 From: Jakub Jelinek To: Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix tst-faccessat.c if run as root Message-ID: <20060115201442.GE4625@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00074.txt.bz2 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 * 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