public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>
To: Ken Brown <kbrown@cornell.edu>, "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: [EXTERNAL] Re: Weird issue with file permissions
Date: Sat, 2 Jul 2022 19:37:05 +0000	[thread overview]
Message-ID: <DM8PR09MB7095B72B7F58F581D3A21B97A5BC9@DM8PR09MB7095.namprd09.prod.outlook.com> (raw)
In-Reply-To: <9e2a5f6a-b0cb-f7b5-a250-a6030ef24f09@cornell.edu>

> what your test program was actually doing.  But you seem to be assuming that
> calling fchmod on a socket descriptor should affect the permissions on the
> socket file (assuming the socket is bound).  Is that documented anywhere?  POSIX
> says that the behavior of fchmod on a socket descriptor is unspecified

The socket file descriptor for a bound UNIX sockets refers to an object in a filesystem
(it's practically a file), which the bind() system call creates.  The access to the socket
is controlled by the permission bits, when someone actually tries to connect to it,
so permissions should be working for these objects (otherwise, there's no other way!)

And fchmod() for a bound Unix socket works on Linux and many other Unix flavors, actually.

Anton Lavrentiev
Contractor NIH/NLM/NCBI

  reply	other threads:[~2022-07-02 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 16:16 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 18:41 ` Ken Brown
2022-07-02 19:37   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] [this message]
2022-07-02 21:58     ` [EXTERNAL] " Ken Brown
2022-07-02 22:01     ` Andrey Repin

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=DM8PR09MB7095B72B7F58F581D3A21B97A5BC9@DM8PR09MB7095.namprd09.prod.outlook.com \
    --to=lavr@ncbi.nlm.nih.gov \
    --cc=cygwin@cygwin.com \
    --cc=kbrown@cornell.edu \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).