public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: SMBFS mount's file cannot be made executable
Date: Wed, 14 Aug 2019 16:59:00 -0000	[thread overview]
Message-ID: <8736i3ptsp.fsf@Rainer.invalid> (raw)
In-Reply-To: <BN6PR09MB14096842C04FD9783DC9C260A5AD0@BN6PR09MB1409.namprd09.prod.outlook.com>	(Anton C. via cygwin Lavrentiev's message of "Wed, 14 Aug 2019	00:53:32 +0000")

Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin writes:
>> If it's related to the ACL handling then it should start working when
>> you remove the ACL on the file with 'setfacl -kb ...'
>
> There are no special ACLs set on the file (that was just produced by
> GCC from the source code, see my first email).

You earlier showed this:

> $ ls -l a.exe
> -rw-rw-r--+ 1 lavr cppcore 157753 Aug 13 08:20 a.exe

See the '+' at the end of the modes?  That's telling you that there is
an ACL added to the file and the modes are the result of combining thje
actual mode bits with the ACL.  As you said, gcc won't add any ACL by
itself, so these ACL are the result of inheritable / default ACL.

> But I am now convinced that the problem is _entirely_ in Cygwin's corner:

Maybe, but we'd still need to know how to get to the result you're seeing.

> When I open that file's the "Properties->Security" Windows tab, I can
> see that my permissions are "Read" and "Write", yet "Read & Execute"
> is NOT checked.  When I check it, I see that the file becomes
> executable (the "x" bit) from both Cygwin shell and on the Linux side,
> too.  And after that, I can execute the file from the Cygwin shell.

I hope it's clear to you that the permissions you see on this tab have
nothing to do with the POSIX mode bits you're trying to set from Cygwin.

> So what happens is that when "chmod" (or "creat" with a permission
> mask) is called, Cygwin does not honor the "x" bit(s) and does not
> convert it to a corresponding proper ACL for the Windows mounted
> filesystem (and that ACL, in turn, would have been then sent to SMBD
> to get converted there back to the "x" bit in the Unix world).  Once
> the "x" is there, Windows(via SMBD) obviously allows execution of the
> image.  Here's a related "bug":

Most often that is the result of an inherited ACL mask that clears that
bit.  Correcting either the default ACL or removing it should then make
that problem go away.  Default ACL are associated with the parent
directory and you're unlikely to be able to change the parent directory
modes if it's the root of a file system exported from a filer.  Try
again in a subdirectory and clear the default ACL with 'setfacl -kb' on
that directory before you start doing anything there.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2019-08-14 16:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  0:53 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-14  2:36 ` Ken Brown
2019-08-14 16:59 ` Achim Gratz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-15  2:00 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-15  9:21 ` L A Walsh
2019-08-15  9:23 ` L A Walsh
2019-08-21  7:12   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-15  1:40 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-15  2:59 ` Brian Inglis
2019-08-14 20:39 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-15  1:31 ` Ken Brown
2019-08-14 14:07 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-15  1:28 ` Ken Brown
2019-08-14  4:24 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-14 11:22 ` Ken Brown
2019-08-14 22:58   ` Brian Inglis
2019-08-12 19:05 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-13  8:28 ` KAVALAGIOS Panagiotis (EEAS-EXT)
     [not found] ` <704986a5a4ab41709eb963dcd23887b1@BELBRU-EXMP101.eeas.europa.eu>
2019-08-13 12:27   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-13 18:34     ` Achim Gratz
2019-08-13 18:35     ` Andrey Repin
2019-08-13 23:19       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-14 20:05         ` Andrey Repin
2019-08-08 15:42 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin

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=8736i3ptsp.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --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).