delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/07/02/10:44:01

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 5A33E3858C2F
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=cornell.edu
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cornell.edu
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=JBf0Z04IiIy6G9KY9ZlMiHvf6uiQLa278HqiSWxIG6r8C672MhzmH0QfwYjXSd03x9fBcBFTvxpXgwcijx5g9y0dMbSjOnXPubs7VCv0P8ECE8lvCvVyCY8g2GkwvdcLknJdJ2BgaHjqMfUyqCNGtoupawqqjDzCePyHtYey/ZCWUUVyPRQRJ7IlpO00nTy7QXYeflEj00LkQ0lcvjGcCvmuUCxusWbOmBlvjOzlW0suaDHh54aMw/WAMPvMKBh/rBv8Ccc6SPccsEXKnH+11cfqOwT0annzSbRYjkGHfD7BkTI5ZexNhgWiwC5rOOyYai+A6pOlZrNCHXlyB5cAgg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=hX2A6o+pWIiMjhoqAmz4l3PvhJ8ME6j+x4AmgUHLgdw=;
b=S3KgNS9gw1etyizBcnCcQRyqNBjNl5T8wcwHHW9P/3nGytOjlqsbrMKZsSgabUaVf+lvIPNTC+SCJr0yLa0Y8VjzSx++Sahn7OgnkXOzT0IzHsJHaaBnj2wFh/5iWuMmvw1jHS+x70cfuRXRyxPgsKxPyGgw3U2lsLD4Tbig4bH82UrC53Y9KpYhP261XqServNe6GyrAjU4ClRFRX/Gw7QkvrEXyubOfsL1wCPF5xoLdHUUinmTOzJ17ZkStpwm3SWSRsPmnLMykUwEnWD484XxYzkp1Nm+jkrVWTSBMTzZ+2ZrqlFaOc25SiYPsAgAqboyNsLAdHhS/X+oHPZscA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=hX2A6o+pWIiMjhoqAmz4l3PvhJ8ME6j+x4AmgUHLgdw=;
b=VZggT+LKTjx4jmo/sHRj/cCDUitTNOfTROycBqMNyEr9pQwRGbnheyDDFXfo4i/Aae02VukhZIUgBmWctKQopXZYPuA9qMzlKyAN+ra6KkSS5nWCbNAaXusdu+a05xwZm82W6KTGOd+CrEMDbdPx4Ln8UTQ/mPZo2NSoaak5GE8=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=cornell.edu;
Message-ID: <55a916bd-92ad-e3ba-1e5b-9be00debc80e@cornell.edu>
Date: Sat, 2 Jul 2022 10:43:17 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Subject: Re: Weird issue with file permissions
To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
References: <DM8PR09MB70951D58CC3208CB938D56B4A5BC9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
From: Ken Brown <kbrown AT cornell DOT edu>
In-Reply-To: <DM8PR09MB70951D58CC3208CB938D56B4A5BC9@DM8PR09MB7095.namprd09.prod.outlook.com>
X-ClientProxiedBy: MN2PR16CA0051.namprd16.prod.outlook.com
(2603:10b6:208:234::20) To BN7PR04MB4388.namprd04.prod.outlook.com
(2603:10b6:406:f8::19)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 7db5e12d-e726-4470-38d7-08da5c39348a
X-MS-TrafficTypeDiagnostic: PH0PR04MB7526:EE_
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: Hddjek5F4V2Xtf6IOVakV9UqO95585PY4iCh3T49BwWV0AD7GmYfMd6pDIglWzrMmBXjBYf6zUG8mAFL1Fg6iOysemLvIhrY4rttYvyKjKRtSXIDgDVDrqPrlOHy/XpoxUk2iRte9Ax2VyJt54x9YRTrWwNUIhnIY3X0B0JEpyH/6QRujDrDeXjmTQiFrJvIVRGW4Et5WPUVDpL0XR+B3ck9Jt606+yElSQvsSfKef+qTC1vniyUId5hh4Qbnh+BcTt30BjeDI2MQD2ay5k6T/JhivcKfqm7K1OzjtFpHM5dCWtsQiXE+oxStagdQIhaK+zpqb9unoYqw4JOt/lEr8ksv0Y8LwPi3Q5KsKvpOQdmEKZlm8bpiELnUb6xVFrCg9VUF7X5se4bl/bUnlYWTQpU5GSTXxTtjNGnn0+ktJ+KMiwW/AqH0/Vjw6qi+xG+FItwLziFiKzWnXu8dsE24ulYayUFdk3b2XwZO3lAMhKqa2wp1+ONcKQ4yTaipCjMuhn01u0evqETaOoVbRvN/kRjXGo/Q3nerfG+RVflm8WfyAmVWjbdh+vdeTRCx89skilrdNjC/G8fp88NkbEsAZA2Mvb7Lxl26K3oRaqqByfKhMl83yFwdsFM8RsFIq8jB2vA8CoYlbiCBcmoSbvhTvf5SBuVgG0C4YTFmBpXPGZdBzGN+rYOjL+99SyDOJnfnTx4zUIlnQgg4gdSuDVjBUTPyfvg736xg33F474ELOoZcAQUWaL8j01/qkyDqMtHN9/pbzqjVA+luYnI8fYQ5h7zlXGVAbCVNivevozqPiDyAR/AMqRpFg8Uo8EJXVFCFx2+K2mBIGIAA4yqc7Bt9XLotWiCclGbxmLTO6NaY1ZYZ9QIjP7rIx7Da6VzqvTKs9KTO8oJl/F1+QKO9Ia6MqiEyqMANQZhWHE1Ie2rIoz82SlLlxeiljeQZ2JwRFcs
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230016)(4636009)(376002)(396003)(366004)(136003)(346002)(39860400002)(110136005)(36756003)(5660300002)(6486002)(66946007)(66556008)(316002)(66476007)(8676002)(31686004)(478600001)(786003)(8936002)(53546011)(6506007)(41300700001)(2616005)(186003)(6512007)(2906002)(75432002)(31696002)(86362001)(41320700001)(83380400001)(38100700002)(45980500001)(43740500002)(460985005)(2480315003);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SVNIblZ3TDJRdUJGT09NUVZmaWVqNFlpM0JyYzNmZHhBUlYxVHNhMmthc3NO?=
=?utf-8?B?VWtaS3NyMG1BQkJYWUZtZnRlajhaRHU3Zjlia3hoMVdCVVZBQUlMUE85MVVI?=
=?utf-8?B?L3F4UXM4K0FTWFYwa00zd2JoWUtrRDVGSC9LN3UwVm5HdzNjaFNFQ2t3T2Nn?=
=?utf-8?B?QWI5TDRFZEdtdGk2VENCeHBsd2RkQnpJZzZvaFBtZ1BYMFhhdVEwZzlmeUxj?=
=?utf-8?B?VGw1Rmx4aTg1OUJLd29Ubk4zMFAxby9DQWNtd2I0VmtvcUlYUjY3ZVFrMEQv?=
=?utf-8?B?dHg1ZWtPWHdhTmJaVUJMdElzd2JTdXJnV2VrM3VFN1R1M24vM2lnR3dDbUlI?=
=?utf-8?B?SW5SQmhGazljY3pBUDJhTVdGY0ZUQVRKbVl1bnVFY1ZHN1UzK0ZT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?=
=?utf-8?Q?8PwHCKgOK4it64IOo4aLv0IGk04wQX+4gfPP92hM47XV?=
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 7db5e12d-e726-4470-38d7-08da5c39348a
X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2022 14:43:19.1648 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pyd9Dk5SnxYb0db7pXCM169jtc447XvbVIT2IieQzFg17gxScnRUdir35YsM56RMArczC2lQQNG+m+n/2bT8Yg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR04MB7526
X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT,
NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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>
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>

On 7/1/2022 11:23 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
>> That way I'm sure I won't have any surprises with permissions when working in
>> /cygdrive/g/cygwin.  Do you want to try that and see if it makes a difference?
> 
> I have no problems with /cygdrive/g/cygwin -- my socket file gets created there with proper
> permissions and reported so, too (both fstat and stat).

Right, I understood that.  But the (default) ACL on that directory influences 
the ACL on subdirectories that are created. And there's also interaction between 
the default ACL and the umask 
(https://man7.org/linux/man-pages/man2/umask.2.html).  So I think it couldn't 
hurt to try my suggestion and then see if you continue to see weird behavior on 
newly created subdirectories.

I just tried this myself on an external hard drive on which I've never touched 
the permissions on the top-level directory.  I do see some weirdness (though not 
as extreme as yours), and the weirdness goes away when I change the ACL as I 
suggested you do.  Here's what I see.  [Note: I use /mnt as the cygdrive prefix.]

$ pwd
/mnt/d

$ getfacl .
# file: .
# owner: Administrators
# group: Unknown+Group
user::---
group::rwx              #effective:---
group:SYSTEM:rwx        #effective:---
mask::---
other::rwx
default:user::rwx
default:group::---
default:group:SYSTEM:rwx        #effective:---
default:mask::---
default:other::rwx

$ mkdir cygwin

$ cd cygwin/

$ getfacl .
# file: .
# owner: kbrown
# group: None
user::rwx
group::r-x
group:SYSTEM:rwx        #effective:r-x
mask::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:SYSTEM:rwx        #effective:r-x
default:mask::r-x
default:other::rwx

$ ./sun
fstat mode = 140666
stat mode = 140646

$ ls -l .socket
srw-r--rw- 1 kbrown None 0 2022-07-02 09:47 .socket=

$ mkdir sub

$ cd sub

$ ../sun.exe
fstat mode = 140666
stat mode = 140646

$ ls -l .socket
srw-r--rw- 1 kbrown None 0 2022-07-02 09:49 .socket=

$ cd ..

$ getfacl ~ | setfacl -f - .

$ getfacl .
# file: .
# owner: kbrown
# group: None
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:other::r-x

$ mkdir sub1

$ cd sub1

$ ../sun.exe
fstat mode = 140666
stat mode = 140666

$ ll .socket
srw-rw-rw- 1 kbrown None 0 2022-07-02 10:04 .socket=

Note that stat and fstat disagreed at first but then agreed after I put a 
standard ACL on the cygwin directory.

Having said all that, I still want to look into why stat and fstat disagree.

Ken

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