X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=cEygC CdhSycADCemfwm57SNvUSB+MZERR/cqwKnKSsBqLWTBz3bcmxDgmgc/F27jqexdx NXiciPRm6oaOHQ1ZkbWndBA9zWahr05bP6a3CW/GwgbQaVbmWxXplzMDP2P3lo1q bcG3DmxHpAbynUsdX61vbRK9wcAfhganxn89rA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=JuYAYYWxFcp e/msVl5zhydl4JJY=; b=v3dk6DLWUq25phYvDPKGpXwtGkNOSauyJVm7xno8/Wg CGagEUwbGgu+SiVFXbDeYF7P+VzssC47CDMhc9NvMwB5GUVdmlV0iGiQbd9XRNXI mnTWqMbCqJ1enfXIs/ZycNkvFazweHzeN6L6b24WyU911MPoQ+T6bYXP9APNWrnI = Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: vsmx009.vodafonemail.xion.oxcs.net From: Achim Gratz To: cygwin AT cygwin DOT com Subject: Re: SMBFS mount's file cannot be made executable References: Date: Wed, 14 Aug 2019 18:59:18 +0200 In-Reply-To: (Anton C. via cygwin Lavrentiev's message of "Wed, 14 Aug 2019 00:53:32 +0000") Message-ID: <8736i3ptsp.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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