From: Ondrej Palkovsky <ondrap@penguin.cz>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: setfsuid() and access() syscall
Date: Wed, 05 Aug 2009 09:57:39 +0200 [thread overview]
Message-ID: <4A793B73.3070709@penguin.cz> (raw)
In-Reply-To: <20090804212912.GK3711@parisc-linux.org>
Matthew Wilcox napsal(a):
> Why does this fileserver want to use access()? WHy not just open the
> file and report the error if one happens
Suppose you want to filter directory and show only the files that the
user can access - yes, this can be solved by opening the file/directory,
however this seems to me overkill.
I have recently been implementing a HTTP file server and I wanted to
show slightly different screens if the user has or does not have write
access - based on ACL. There is no easy way to do it in multithreaded
application
- the access() function does not work. There is an
euidaccess()/eaccess() libc function, which is not currently syscall -
it is probably supposed to do the ACL checks in userspace and it doesn't
currently support ACL's anyway (NotYetImplemented). But doing ACL checks
in userspace is IMO the wrong way to go - the ACL models differ.
(I have since switched to fork()ed model, but this option might not
always be available).
And if I understand it correctly, the posix says that there is a problem
- and it won't be solved.... :(
2. The superuser has complete access to all files on a system. As a
consequence, programs started by the superuser and switched to the
effective user ID with lesser privileges cannot use /access/() to test
their file access permissions.
It was also argued that problem (2) is more easily solved by using
/open/()
<http://www.opengroup.org/onlinepubs/000095399/functions/open.html>,
/chdir/()
<http://www.opengroup.org/onlinepubs/000095399/functions/chdir.html>, or
one of the /exec
<http://www.opengroup.org/onlinepubs/000095399/functions/exec.html>/
functions as appropriate and responding to the error, rather than
creating a new function that would not be as reliable. Therefore,
/eaccess/() is not included in this volume of IEEE Std 1003.1-2001.
Ondrej
next prev parent reply other threads:[~2009-08-05 7:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 20:55 setfsuid() and access() syscall Ondrej Palkovsky
2009-08-04 21:29 ` Matthew Wilcox
2009-08-05 7:57 ` Ondrej Palkovsky [this message]
2009-08-04 21:53 ` Serge E. Hallyn
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=4A793B73.3070709@penguin.cz \
--to=ondrap@penguin.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=matthew@wil.cx \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.