delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/11/05:32:25

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4ABAWPCY3772356
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4ABAWPCY3772356
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=R/fYqd1I
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F30E3858D39
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1731321143;
bh=1x/xhTGL2trKs5kRRXdhyHbEXb30gbM7Wkek4vn1LRI=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=R/fYqd1IDqmZpo/xWwCMpWjcmmkxLMvMa0SgiezXd0p3HUm5BiDIB4qXouWl0E2Bb
Mw6sVETSCdlmj5cNzGCXY8Tu6oFi6M6d9Yh2JO8rAO6/llnWGV8D6F7WtnPWE0ILDf
W1jsQ07zCSdQYUQfJ1XlwND+KEA92At1iWBmJmF8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF70A3858D21
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF70A3858D21
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731321120; cv=none;
b=cjGhRwf3CgM0oGwNMAnlmmZdLeSY5cCFdFLz3cknJVlzgIU+g2Yza/jXdq5X8P1yNV4FbaoHKw93vM1DBI3Sxt80fN9tbpk5jvY9/kNM9wJUJu77C60UzfNy38NhUl6qL3HhgRUNVOgIvB8p36ACUSpYMeUcRc48/MRhlQd2O2M=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1731321120; c=relaxed/simple;
bh=fkiw6jCJY4dUZt/3LDwmoIXeFI1N01JZpLRV/u1yGoE=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=ehTjYR2PtV69U79MCiBEBlz+JgMxOMghGwfuxKZ89XP7cgG4xL4PyQVbbtCLP3g0SC2mBZoGoumle6uVGRKBEWyTzsRaYRpavqmi6UUZzWYDszgHhGWblFroHE8V709jQbTuMsjX/ob4eskMMQ1ZeC71pg74kVPZiVoZKtPq6M0=
ARC-Authentication-Results: i=1; server2.sourceware.org
Date: Mon, 11 Nov 2024 19:31:52 +0900
To: cygwin AT cygwin DOT com
Subject: Re: SMBFS mount's file cannot be made executable
Message-Id: <20241111193152.c3a81044a03ecf2093185166@nifty.ne.jp>
In-Reply-To: <Zy4ODHHpmZPggGSz@calimero.vinschen.de>
References: <BL0PR0901MB430827F1A0668E468B498FBBA5D70 AT BL0PR0901MB4308 DOT namprd09 DOT prod DOT outlook DOT com>
<20241108205109 DOT 55f99e2d172b9fc87e92ae67 AT nifty DOT ne DOT jp>
<Zy4ODHHpmZPggGSz AT calimero DOT vinschen DOT de>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi Corinna,

On Fri, 8 Nov 2024 14:11:40 +0100
Corinna Vinschen wrote:
> On Nov  8 20:51, Takashi Yano via Cygwin wrote:
> > Hi all,
> > 
> > On Thu, 8 Aug 2019 15:41:55 +0000
> > "Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > > Hi,
> > > 
> > > Here's the situation, I have a netmount "Z:" but I cannot make any files on it executable from Cygwin:
> > > 
> > > $ mount
> > > ...
> > > Z: on /cygdrive/z type smbfs (binary,posix=0,user,noumount,auto)
> > > [...]
> > > $ ls -l a.exe
> > > -rw-rw-r--+ 1 lavr cppcore 157753 Aug  8 11:29 a.exe
> > > [...]
> > > $ chmod a+x a.exe
> > > [...]
> > > $ ls -l a.exe
> > > -rw-rw-r--+ 1 lavr cppcore 157753 Aug  8 11:29 a.exe
> > > [...]
> > > Also, any file that I give the "x" permission from outside Cygwin (e.g. from Linux) on the SMBFS drive "Z:",
> > > becomes executable:
> > 
> > Does anyone know what was the conclusion of this issue?
> > I have encountered the same issue and cannot find the
> > solution so far.
> 
> SMB is really complex, and Samba adds to the complexity.
> 
> If the remote drive is a Windows share, check if the server shares the
> folder with "Full Control" for everyone.
> 
> If the server is a Samba share, check if `force unknown acl user = yes'
> and for the share itself, check that
> 
>   read only = No
>   vfs objects = acl_xattr
    ^^^^^^^^^^^^^^^^^^^^^^^
Thanks! This makes things better.
At least x permissions are set to executable compiled by gcc.

However, something is still wrong in my environment....
Others permission seems to be reffered in some cases.

>   map acl inherit = Yes
>   store dos attributes = Yes
> 
> Not sure if that helps, but I don't have any other idea.  I'm running
> Samba in an AD environment and "it works for me" :-P

I looked into this probelm and found the NtAccessCheck() fails
for my samba environment.

It seems that next patch solves this.

diff --git a/winsup/cygwin/sec/base.cc b/winsup/cygwin/sec/base.cc
index d5e39d281..c519af6e0 100644
--- a/winsup/cygwin/sec/base.cc
+++ b/winsup/cygwin/sec/base.cc
@@ -681,6 +681,9 @@ convert_samba_sd (security_descriptor &sd_ret)
 				     ace->Header.AceFlags))
 	  return;
       }
+  /* Samba without AD seems to need this. */
+  add_access_allowed_ace (acl, FILE_ALL_ACCESS,
+			  well_known_authenticated_users_sid, acl_len, 0);
   acl->AclSize = acl_len;
 
   RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);

What do you think?

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019