mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Dmitry Selyutin <ghostman.sd@gmail.com>
To: Dmitry Selyutin <ghostmansd@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: readdir(3): behavior on descriptors with O_SEARCH
Date: Sun, 28 Aug 2016 12:02:02 +0300	[thread overview]
Message-ID: <CAMqzjevHwQ294izEcafMPgv_UUQWBWmWwAe2XCN8=07LkPOojg@mail.gmail.com> (raw)
In-Reply-To: <CAMqzjevR-KgqLi7aR28=G+SAweeQ+V6ZUad5BmY=4QF-+GvdkQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

I think the mistery is partially solved: glibc simply doesn't have
O_SEARCH, so the following code

#ifdef O_SEARCH
flags |= O_SEARCH
#endif

does not execute (so only O_DIRECTORY is being set). Dumb, had to check
twice, sorry for the noise.

However, the question if it is correct to define O_SEARCH to be equal to
O_PATH. From what I see, both O_SEARCH and O_EXEC have the same value as
O_PATH, but I'm not sure if this solution is technically correct.

However, I suspect that support for O_EXEC and O_SEARCH must be provided by
the kernel first, so until kernel implements such functionality, all talks
seem to be meaningless (unless someone wants to emulate such functionality
in the userspace). Anyway, I tend to think that any attempt to use O_SEARCH
until then should either return -1 on open(3), or NULL on fdopendir(3); I
really don't think that O_SEARCH shall mean the same as O_PATH.

But I'm by no means claim myself to be a POSIX expert; what do you think?
The information on O_SEARCH seems to be incomplete and even inconsistent,
so it may turn that my claims are incorrect. Any suggestions are welcome;
I'll take a more deep look at it in the evening.

And again, thank you for your help!

[-- Attachment #2: Type: text/html, Size: 1355 bytes --]

  reply	other threads:[~2016-08-28  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMqzjetOkwQ7wi4p3MY_HT46v6pVRh_eHSi6SbwC96qoz+ivFg@mail.gmail.com>
2016-08-27 18:23 ` Dmitry Selyutin
2016-08-28  7:10   ` Markus Wichmann
2016-08-28  8:12     ` Dmitry Selyutin
2016-08-28  9:02       ` Dmitry Selyutin [this message]
2016-08-28 15:06         ` Rich Felker
2016-08-28 16:02           ` Dmitry Selyutin
2016-08-28 16:20             ` Rich Felker
2016-08-28 17:14               ` Dmitry Selyutin

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='CAMqzjevHwQ294izEcafMPgv_UUQWBWmWwAe2XCN8=07LkPOojg@mail.gmail.com' \
    --to=ghostman.sd@gmail.com \
    --cc=ghostmansd@gmail.com \
    --cc=musl@lists.openwall.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.
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).