delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/07/02/18:05:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 526133858C2D
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=yandex.ru
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru
X-Yandex-Fwd: 2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
t=1656799501; bh=QWxFI4ls2rIWR2+fMM/O4VFAdEKzftbbOxwR3Zs7Gzs=;
h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To;
b=SBl0M7J6GhLOSl+NGgNRtzNhF42MnUntrYkVblhuFHhDQ+w06sn0NM+Z1d6aTXKD8
ap2r7rnOydkwBZS8KKzUtZ2L9MSc4Ov6kWwG48S+HJ3iwA2uQD7nWpKAwzOmn+TvmS
hgSEBmc6vvVmAl00bxVAOKYRwdoD15/oYnAbKgQw=
Authentication-Results: myt6-93965afc2133.qloud-c.yandex.net;
dkim=pass header.i=@yandex.ru
Date: Sun, 3 Jul 2022 01:01:16 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
X-Mailer: The Bat! (v9.3.4) Professional
Message-ID: <1358206197.20220703010116@yandex.ru>
To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>,
cygwin AT cygwin DOT com
Subject: Re: [EXTERNAL] Re: Weird issue with file permissions
In-Reply-To: <DM8PR09MB7095B72B7F58F581D3A21B97A5BC9@DM8PR09MB7095.namprd09.prod.outlook.com>
References: <DM8PR09MB7095CE12D39F3F81CBB15536A5BC9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
<9e2a5f6a-b0cb-f7b5-a250-a6030ef24f09 AT cornell DOT edu>
<DM8PR09MB7095B72B7F58F581D3A21B97A5BC9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT 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...


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019