X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 459043853560
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=huarp.harvard.edu
Authentication-Results: sourceware.org;
 spf=pass smtp.mailfrom=huarp.harvard.edu
Message-ID: <dd5e2750-5d86-0283-84fb-ef10efd4a8a0@huarp.harvard.edu>
Date: Wed, 29 Jun 2022 09:18:24 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.10.0
Subject: Re: chmod g+s ineffective
Content-Language: en-US
To: cygwin@cygwin.com
References: <9c053381-4466-ea8a-11d6-ea2e676d3b35@huarp.harvard.edu>
 <792558531.20220629153952@yandex.ru>
From: Norton Allen <allen@huarp.harvard.edu>
In-Reply-To: <792558531.20220629153952@yandex.ru>
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham 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 <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On 6/29/2022 7:39 AM, Andrey Repin wrote:
> Greetings, Norton Allen!
>
>> On one machine I have, chmod g+s fails to set the sticky bit. The command
>> does not return any error, but ls -l continues to show the bit not set.
>>      $ mkdir foo
>>      $ chgrp flight foo
>>      $ chmod g+ws foo
>>      $ ls -ld foo
>>      drwxrwxr-x+ 1 nort flight 0 Jun 29 06:50 foo
> ----------------^
>
> $ getfacl foo

I will collect this shortly, but IIRC, getfacl showed it was not set. I 
did see it set there under 'flags' on the system that works.


>
>> I ran strace, and it looks like the correct system call parameter is getting passed.
>> I am curious as to how the sticky bit is implemented.
> First see if it was set or not.
>
>> It isn't obvious what underlying Windows functionality (if any) is applied.
> It does. But the big question is, where do you try to do that.
> If this is inside Cygwin installation root, then things could work more or
> less POSIX'y. If this is outside Cygwin root (f.e. in your system profile), it
> may or may not work completely, depends how did you mount /cygdrive prefix.

I will confirm (shortly), but I'm pretty sure these tests were done 
under vanilla /home (so c:\cygwin64\home)


>
>> Ah, just checked on a system where this works, and creating a file in the
>> directory from the
>> command shell does not set the group, so presumably this functionality is
>> all within cygwin. That works for my application, except when it doesn't.
>> Any suggestions on what I should look for?
> Look if you could avoid using +s. Isn't DACL enough?

Am I correct that DACL is not available unless I am on a domain? This is 
for a field computer, so connection to a domain is generally more 
problematic than helpful.


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