public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: Weird issue with file permissions
Date: Fri, 1 Jul 2022 13:03:54 -0400	[thread overview]
Message-ID: <7d33f3f1-c701-06eb-f98a-0b9790678b54@cornell.edu> (raw)
In-Reply-To: <DM8PR09MB709508104694224E0803C069A5BD9@DM8PR09MB7095.namprd09.prod.outlook.com>

On 7/1/2022 1:46 AM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
> Now, if I run this code in my Cygwin home directory (and any directory that I create using "mkdir..." under it),
> I am getting the expected results:
> 
> $ ~/sun
> fstat mode = 140666
> stat mode = 140666
> 
> $ ls -l .socket
> srw-rw-rw-+ 1 ANTON None 0 Jul  1 01:19 .socket=
> 
> However, if I run it elsewhere (different drive "cd /cygdrive/g/cygwin" -- it's NOT where Cygwin is installed,
> just a folder that keeps files for Cygwin development, the installation is on C:\Cygwin64), I cannot predict
> the results.  What's weird is that fstat and stat report different file modes.
> 
> $ pwd
> /cygdrive/g/cygwin
> $ ~/sun
> fstat mode = 140666
> stat mode = 140666
> $ ls -l .socket
> srw-rw-rw-+ 1 ANTON None 0 Jul  1 01:24 .socket=
> 
> So all's good here, BUT:
> 
> $ mkdir subdir
> $ cd subdir
> $ pwd
> /cygdrive/g/cygwin/subdir
> $ ~/sun
> fstat mode = 140666
> stat mode = 140664
> $ ls -l .socket
> srw-rw-r--+ 1 ANTON None 0 Jul  1 01:25 .socket=
> 
> Note that fstat lied!
> 
> For some reason getfacl returns "Not supported", so I could not investigate with that

Can you give us more information about where that error is coming from?  Are you 
able to run getfacl under gdb and show us a backtrace from that point?  I often 
find it helpful to first run the program under strace in order to locate the 
source of the error, so I know where to set a breakpoint in gdb.

And what can you tell us about the drive /cygdrive/g?  The failure of getfacl 
suggests that Cygwin thinks the drive doesn't support ACLs, in which case it 
might just be faking permissions (lying).

Ken

  reply	other threads:[~2022-07-01 17:03 UTC|newest]

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

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=7d33f3f1-c701-06eb-f98a-0b9790678b54@cornell.edu \
    --to=kbrown@cornell.edu \
    --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).