public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Chris Wagner <wagnerc@plebeian.com>
To: cygwin@cygwin.com
Subject: Re: chmod g+s ineffective
Date: Sun, 10 Jul 2022 22:17:12 -0400	[thread overview]
Message-ID: <ddda74cf906b99988ecbbb30f6f5ef0a@plebeian.com> (raw)
In-Reply-To: <463526579.20220701025601@yandex.ru>

>> On 6/29/2022 9:18 AM, Norton Allen wrote:
>>>>> 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

Hi.  The permission bits are implemented as normal Window's DACLs 
(Discretionary Access List).  +s is implemented magically with the NULL 
SID.  You can view it from Explorer or with icacls.  Try checking the 
return code (echo $?) from chmod.  Also try changing perms from 
Explorer.  You might not be able to set the NULL SID for some reason.

It works for me:
$ ls -ld z
drwxrwsr-x+ 1 wagnerc Users 0 Nov 24  2020 z

$ getfacl z
# file: z
# owner: wagnerc
# group: Users
# flags: -s-
user::rwx
group::r-x
group:Administrators:rwx
group:Users:rwx
mask::rwx
other::r-x
default:user::rwx
default:user:wagnerc:rwx
default:group::r-x
default:group:Administrators:rwx
default:group:Users:rwx
default:mask::rwx
default:other::r-x


$ icacls z
z NULL SID:(DENY)(Rc,S,WD,REA,WEA,X,DC)
   APPLEJACK\wagnerc:(F)
   BUILTIN\Users:(RX)
   BUILTIN\Administrators:(RX,W,DC)
   BUILTIN\Users:(RX,W,DC)
   Everyone:(RX)
   NULL SID:(OI)(CI)(IO)(DENY)(Rc,S,WD,REA,WEA,X,DC)
   CREATOR OWNER:(OI)(CI)(IO)(F)
   APPLEJACK\wagnerc:(OI)(CI)(IO)(RX,W,DC)
   BUILTIN\Users:(OI)(CI)(IO)(RX)
   BUILTIN\Administrators:(OI)(CI)(IO)(RX,W,DC)
   BUILTIN\Users:(OI)(CI)(IO)(RX,W,DC)
   Everyone:(OI)(CI)(IO)(RX)

Successfully processed 1 files; Failed processing 0 files

$ uname -a
CYGWIN_NT-6.1 applejack 3.1.0(0.340/5/3) 2019-11-19 13:58 x86_64 Cygwin



Thanks.

  reply	other threads:[~2022-07-11  2:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 12:12 Norton Allen
2022-06-29 12:39 ` Andrey Repin
2022-06-29 14:18   ` Norton Allen
2022-06-29 17:51     ` Norton Allen
2022-06-30 23:56       ` Andrey Repin
2022-07-11  2:17         ` Chris Wagner [this message]
2022-07-11  2:33           ` Eliot Moss
2022-07-11 16:49             ` Norton Allen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddda74cf906b99988ecbbb30f6f5ef0a@plebeian.com \
    --to=wagnerc@plebeian.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).