public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>,
	 cygwin@cygwin.com
Subject: Re: [EXTERNAL] Re: Weird issue with file permissions
Date: Sun, 3 Jul 2022 01:01:16 +0300	[thread overview]
Message-ID: <1358206197.20220703010116@yandex.ru> (raw)
In-Reply-To: <DM8PR09MB7095B72B7F58F581D3A21B97A5BC9@DM8PR09MB7095.namprd09.prod.outlook.com>

Greetings, Lavrentiev, Anton (NIH/NLM/NCBI) [C]!

>> 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,

Which is not necessarily related to the permissions on the file. Windows
socket is an in-memory object, the file is used merely for naming purposes.

> so permissions should be working for these objects (otherwise, there's no other way!)

Does the not? Can you connect to a socket with user that should not have
permissions after you have changed them?

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

"Works", all right. But HOW does it works? Aren't the permissions seen on the
socket file merely a coincidence/convenience?


-- 
With best regards,
Andrey Repin
Sunday, July 3, 2022 00:57:58

Sorry for my terrible english...


      parent reply	other threads:[~2022-07-02 22:05 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   ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 21:58     ` Ken Brown
2022-07-02 22:01     ` Andrey Repin [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=1358206197.20220703010116@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=lavr@ncbi.nlm.nih.gov \
    /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).