linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Oleg Verych <olecom@gmail.com>
Cc: Matthew Wilcox <matthew@wil.cx>, linux-fsdevel@vger.kernel.org
Subject: Re: euidaccess() as syscall
Date: Fri, 2 May 2008 18:33:43 +0100	[thread overview]
Message-ID: <20080502173343.GB1240@shareable.org> (raw)
In-Reply-To: <8499950a0805021013g76261641r847ab18e648693a1@mail.gmail.com>

Oleg Verych wrote:
> 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?

The whole point of access() originally seems to be so you can check
the real-user permissions, as there is no reliable way to do that
otherwise.

euidaccess() was added much later.  As noted, you can use open()
instead.  This is one reason why open() shouldn't change the
timestamps: only reading and writing should do that.

Windows has an additional open flag OF_EXIST, which lets you call the
Windows equivalent of open() and just check if you can, with the
specified open flags, without returning a handle.  Perhaps Linux could
copy that idea with an O_ACCESS flag to open()?

-- Jamie

  reply	other threads:[~2008-05-02 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 16:59 euidaccess() as syscall Oleg Verych
2008-05-02 17:06 ` Matthew Wilcox
2008-05-02 17:13   ` Oleg Verych
2008-05-02 17:33     ` Jamie Lokier [this message]
2008-05-02 18:45       ` Oleg Verych
2008-05-05 19:21         ` code example (Re: euidaccess() as syscall) Oleg Verych
2008-05-02 17:35     ` euidaccess() as syscall Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080502173343.GB1240@shareable.org \
    --to=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=olecom@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).