mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: Rob Landley <rob@landley.net>,
	musl@lists.openwall.com, toybox@lists.landley.net
Subject: Re: Re: faccessat and AT_SYM_NOFOLLOW
Date: Mon, 29 Sep 2014 12:40:29 -0400	[thread overview]
Message-ID: <20140929164029.GZ23797@brightrain.aerifal.cx> (raw)
In-Reply-To: <alpine.LNX.2.00.1409292021450.26966@monopod.intra.ispras.ru>

On Mon, Sep 29, 2014 at 08:27:19PM +0400, Alexander Monakov wrote:
> Isn't the reason for faccessat call before unlink is that rm without the -f
> flag is explicitely specified to ask for confirmation when the file is not
> writable?

This may be true (it was never stated when I asked about the purpose),
but in that case, faccessat still won't give the correct result unless
you use AT_EACCESS (which is broken with glibc and very expensive with
musl). The right way to achieve this would be to attempt to open the
file (or performing some other operation that would check for write
access with the correct effective/fs uid/gid) for writing before
unlinking it.

Rich


      reply	other threads:[~2014-09-29 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 16:01 Rich Felker
2014-09-25 16:46 ` u-wsnj
2014-09-25 21:03   ` Justin Cormack
2014-09-25 21:15     ` Rich Felker
     [not found] ` <20140925160110.GA25937-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2014-09-28 17:05   ` Rob Landley
2014-09-28 21:20     ` Rich Felker
2014-09-29 16:27       ` Alexander Monakov
2014-09-29 16:40         ` Rich Felker [this message]

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=20140929164029.GZ23797@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=amonakov@ispras.ru \
    --cc=musl@lists.openwall.com \
    --cc=rob@landley.net \
    --cc=toybox@lists.landley.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).