public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>
To: Ken Brown <kbrown@cornell.edu>, "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: Weird issue with file permissions
Date: Fri, 1 Jul 2022 18:00:01 +0000	[thread overview]
Message-ID: <DM8PR09MB7095238F3C4EA53DAC7A4179A5BD9@DM8PR09MB7095.namprd09.prod.outlook.com> (raw)

getfacl does not work even for the .socket "file" in my home directory for which ~/sun works perfectly fine with permissions
(and all subdirectories crated with mkdir under it).

Also like I said, ~/sun also works perfectly fine in /cygdrive/g/cygwin/ but not if I created a subdirectory with the shell's mkdir command.

> Can you give us more information about where that error is coming from?  Are you

These are the relevant parts from strace (I think):

for "getfacl .socket" while in my $HOME:

   62   25757 [main] getfacl 33904 symlink_info::check: 0x0 = NtCreateFile (\??\C:\cygwin64\home\ANTON\.socket)
   95   25852 [main] getfacl 33904 symlink_info::check: not a symlink
   31   25883 [main] getfacl 33904 symlink_info::check: 0 = symlink.check(C:\cygwin64\home\ANTON\.socket, 0xFFFFB860) (mount_flags 0x30008, path_flags 0x20)
   26   25909 [main] getfacl 33904 path_conv::check: this->path(C:\cygwin64\home\ANTON\.socket), has_acls(1)
   28   25937 [main] getfacl 33904 build_fh_pc: fh 0x18035FE50, dev 001E0078
   25   25962 [main] getfacl 33904 __set_errno: virtual __acl_t* fhandler_base::acl_get(acl_type_t):565 setting errno 134

for "getfacl .socket" while in /cygdrive/g/cygwin:

  114   29018 [main] getfacl 34007 symlink_info::check: 0x0 = NtCreateFile (\??\G:\cygwin\.socket)
  194   29212 [main] getfacl 34007 symlink_info::check: not a symlink
   30   29242 [main] getfacl 34007 symlink_info::check: 0 = symlink.check(G:\cygwin\.socket, 0xFFFFB8F0) (mount_flags 0x4020, path_flags 0x20)
   45   29287 [main] getfacl 34007 path_conv::check: this->path(G:\cygwin\.socket), has_acls(1)
   58   29345 [main] getfacl 34007 build_fh_pc: fh 0x18035FE40, dev 001E0078
   37   29382 [main] getfacl 34007 stat_worker: (\??\G:\cygwin\.socket, 0xFFFFCB60, 0x18035FE40), file_attributes 36
  212   29594 [main] getfacl 34007 transport_layer_pipes::connect: Try to connect to named pipe: \\.\pipe\cygwin-e022582115c10879-lpc
  202   29796 [main] getfacl 34007 transport_layer_pipes::connect: Try to connect to named pipe: \\.\pipe\cygwin-e022582115c10879-lpc
  205   30001 [main] getfacl 34007 transport_layer_pipes::connect: Try to connect to named pipe: \\.\pipe\cygwin-e022582115c10879-lpc
  145   30146 [main] getfacl 34007 transport_layer_pipes::connect: Try to connect to named pipe: \\.\pipe\cygwin-e022582115c10879-lpc
  175   30321 [main] getfacl 34007 fhandler_base::fstat_helper: 0 = fstat (\??\G:\cygwin\.socket, 0xFFFFCB60) st_size=54, st_mode=0140666, st_ino=1407374883583365st_atim=62BF3147.159B86B4 st_ctim=62BF3147.16341D34 st_mtim=62BF3147.16341D34 st_birthtim=62BF3147.159B86B4
   52   30373 [main] getfacl 34007 stat_worker: 0 = (\??\G:\cygwin\.socket,0xFFFFCB60)
   62   30435 [main] getfacl 34007 normalize_posix_path: src .socket
   27   30462 [main] getfacl 34007 cwdstuff::get: posix /cygdrive/g/cygwin
   33   30495 [main] getfacl 34007 cwdstuff::get: (/cygdrive/g/cygwin) = cwdstuff::get (0x800000010, 32768, 1, 0), errno 0
   32   30527 [main] getfacl 34007 normalize_posix_path: /cygdrive/g/cygwin/.socket = normalize_posix_path (.socket)
   25   30552 [main] getfacl 34007 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/g/cygwin/.socket)
   28   30580 [main] getfacl 34007 mount_info::cygdrive_win32_path: src '/cygdrive/g/cygwin/.socket', dst 'G:\cygwin\.socket'
   29   30609 [main] getfacl 34007 mount_info::conv_to_win32_path: src_path /cygdrive/g/cygwin/.socket, dst G:\cygwin\.socket, flags 0x4020, rc 0
   56   30665 [main] getfacl 34007 symlink_info::check: 0x0 = NtCreateFile (\??\G:\cygwin\.socket)
  128   30793 [main] getfacl 34007 symlink_info::check: not a symlink
   55   30848 [main] getfacl 34007 symlink_info::check: 0 = symlink.check(G:\cygwin\.socket, 0xFFFFB860) (mount_flags 0x4020, path_flags 0x20)
   35   30883 [main] getfacl 34007 path_conv::check: this->path(G:\cygwin\.socket), has_acls(1)
   43   30926 [main] getfacl 34007 build_fh_pc: fh 0x18035FE40, dev 001E0078
   36   30962 [main] getfacl 34007 __set_errno: virtual __acl_t* fhandler_base::acl_get(acl_type_t):565 setting errno 134

I see that it is trying to connect to cygserver and it's actually running on my machine.
If I stop it, ~/sun still can't create proper permissions in a cygwin-made subdirectory,
and getfacl shows a longer trace but the same "Not supported" outcome.

> And what can you tell us about the drive /cygdrive/g?

$ mount
C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin64 on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
G: on /cygdrive/g type ntfs (binary,posix=0,user,noumount,auto)
I: on /cygdrive/i type ntfs (binary,posix=0,user,noumount,auto)

But if I created a subdirectory in G:\cygwin from Windows (e.g. with cmd's mkdir), then sun.c would work!

$ cmd /c 'mkdir G:\cygwin\subdir-cmd'
$ cd /cygdrive/g/cygwin/subdir-cmd
$ ~/sun
fstat mode = 140666
stat mode = 140666
$ ls -l .socket
srw-rw-rw-+ 1 ANTON None 0 Jul  1 13:40 .socket=

$ icacls .
. BUILTIN\Administrators:(I)(F)
  BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
  NT AUTHORITY\SYSTEM:(I)(F)
  NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
  NT AUTHORITY\Authenticated Users:(I)(M)
  NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)
  BUILTIN\Users:(I)(RX)
  BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)

$ icacls .socket
.socket NULL SID:(DENY)(Rc,S,WEA,X,DC)
        ANTON\ANTON:(R,W,D,WDAC,WO)
        ANTON\None:(DENY)(S,X)
        NT AUTHORITY\Authenticated Users:(DENY)(S,X)
        NT AUTHORITY\SYSTEM:(DENY)(S,X)
        BUILTIN\Administrators:(DENY)(S,X)
        BUILTIN\Users:(DENY)(S,X)
        ANTON\None:(RX,W)
        NT AUTHORITY\Authenticated Users:(RX,W)
        NT AUTHORITY\SYSTEM:(RX,W)
        BUILTIN\Administrators:(RX,W)
        BUILTIN\Users:(RX,W)
        Everyone:(R,W)

Lastly, I forgot to list all the involved directories as they look from under Cygwin with their permissions,
if that's of any help:

$ ls -ld ~ ~/.socket ~/subdir ~/subdir/.socket
drwx------+ 1 ANTON None 0 Jul  1 13:36 /home/ANTON/
srw-rw-rw-  1 ANTON None 0 Jul  1 13:36 /home/ANTON/.socket=
drwxr-xr-x+ 1 ANTON None 0 Jul  1 13:36 /home/ANTON/subdir/
srw-rw-rw-  1 ANTON None 0 Jul  1 13:36 /home/ANTON/subdir/.socket=

$ ls -ld /cygdrive/g/cygwin /cygdrive/g/cygwin/.socket /cygdrive/g/cygwin/subdir /cygdrive/g/cygwin/subdir/.socket /cygdrive/g/cygwin/subdir-cmd /cygdrive/g/cygwin/subdir-cmd/.socket
drwxrwx---+ 1 ANTON None 0 Jul  1 13:40 /cygdrive/g/cygwin/
srw-rw-rw-+ 1 ANTON None 0 Jul  1 13:39 /cygdrive/g/cygwin/.socket=
drwxrwxr-x+ 1 ANTON None 0 Jul  1 13:39 /cygdrive/g/cygwin/subdir/
srw-rw-r--+ 1 ANTON None 0 Jul  1 13:39 /cygdrive/g/cygwin/subdir/.socket=
drwxrwx---+ 1 ANTON None 0 Jul  1 13:40 /cygdrive/g/cygwin/subdir-cmd/
srw-rw-rw-+ 1 ANTON None 0 Jul  1 13:40 /cygdrive/g/cygwin/subdir-cmd/.socket=

Anton Lavrentiev
Contractor NIH/NLM/NCBI

             reply	other threads:[~2022-07-01 18:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 18:00 Lavrentiev, Anton (NIH/NLM/NCBI) [C] [this message]
2022-07-01 19:01 ` Ken Brown
2022-07-01 20:59 ` Ken Brown
  -- strict thread matches above, loose matches on Subject: below --
2022-07-03  1:51 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 16:16 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 18:41 ` Ken Brown
2022-07-02  3:23 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 14:43 ` Ken Brown
2022-07-01 22:11 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-01 23:16 ` Ken Brown
2022-07-01  5:46 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-01 17:03 ` Ken Brown

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=DM8PR09MB7095238F3C4EA53DAC7A4179A5BD9@DM8PR09MB7095.namprd09.prod.outlook.com \
    --to=lavr@ncbi.nlm.nih.gov \
    --cc=cygwin@cygwin.com \
    --cc=kbrown@cornell.edu \
    /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).