From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Oleg Verych" Subject: Re: euidaccess() as syscall Date: Fri, 2 May 2008 18:13:00 +0100 Message-ID: <8499950a0805021013g76261641r847ab18e648693a1@mail.gmail.com> References: <8499950a0805020959g5114c9c9wa3803a9d1eab3147@mail.gmail.com> <20080502170603.GJ14976@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: "Matthew Wilcox" Return-path: Received: from rv-out-0506.google.com ([209.85.198.239]:19333 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbYEBRNB (ORCPT ); Fri, 2 May 2008 13:13:01 -0400 Received: by rv-out-0506.google.com with SMTP id l9so161165rvb.1 for ; Fri, 02 May 2008 10:13:00 -0700 (PDT) In-Reply-To: <20080502170603.GJ14976@parisc-linux.org> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Matthew Wilcox @ Fri, May 2, 2008 at 6:06 PM: > On Fri, May 02, 2008 at 05:59:36PM +0100, Oleg Verych wrote: > > Hallo. > > > > Why there's no euidaccess() syscall (most obvious use is in `test` or > > `[` utility)? > > > > Instead euiaccess() in glibc and access() in kernel are doing unnecessary uid > > shuffling. > > Are there any programs which care? Do you have a benchmark that might > show an improvement if we added an euidaccess() syscall? > > My impression was that most programs ignore the access() family of > syscalls and just try to do the open and cope with the failure. They > have to anyway, since the file could have changed permission between the > call to access() and the call to open(). open() will change timestamp. `bash` and `dash` have very broken workarounds of access() in `test` due to euid requirements. I.e. read-only fs for root or various selinux-like restrictions are not shown unless open() is used. So, it's better just to use stat64(), right? ____