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 X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <1358206197.20220703010116@yandex.ru> To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" , cygwin AT cygwin DOT com Subject: Re: [EXTERNAL] Re: Weird issue with file permissions In-Reply-To: References: <9e2a5f6a-b0cb-f7b5-a250-a6030ef24f09 AT cornell DOT edu> 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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