From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500o.mail.yandex.net (forward500o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::610]) by sourceware.org (Postfix) with ESMTPS id 526133858C2D for ; Sat, 2 Jul 2022 22:05:04 +0000 (GMT) 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 Received: from myt6-93965afc2133.qloud-c.yandex.net (myt6-93965afc2133.qloud-c.yandex.net [IPv6:2a02:6b8:c12:5525:0:640:9396:5afc]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 0C7CF941B10; Sun, 3 Jul 2022 01:05:02 +0300 (MSK) Received: from myt6-265321db07ea.qloud-c.yandex.net (myt6-265321db07ea.qloud-c.yandex.net [2a02:6b8:c12:2626:0:640:2653:21db]) by myt6-93965afc2133.qloud-c.yandex.net (mxback/Yandex) with ESMTP id kPjbRxO0l5-51f4FVoq; Sun, 03 Jul 2022 01:05:01 +0300 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 Received: by myt6-265321db07ea.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id aaWrPJFFmH-50N4F8Su; Sun, 03 Jul 2022 01:05:00 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Sat, 02 Jul 2022 22:01:16 -0000 Date: Sun, 3 Jul 2022 01:01:16 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Reply-To: cygwin@cygwin.com Message-ID: <1358206197.20220703010116@yandex.ru> To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" , cygwin@cygwin.com Subject: Re: [EXTERNAL] Re: Weird issue with file permissions In-Reply-To: References: <9e2a5f6a-b0cb-f7b5-a250-a6030ef24f09@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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@cygwin.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: , X-List-Received-Date: Sat, 02 Jul 2022 22:05:06 -0000 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...