X-Recipient: archive-cygwin@delorie.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:reply-to:to:subject:date:message-id
	:content-type:content-transfer-encoding:mime-version; q=dns; s=
	default; b=EgZqcxpUe5pd+AKvk21XKLd5eCnuA+nYH4xgNSMOhdq/i4TfVJr/M
	rNJ2VC3MtpVO3lXKPOqzmReGmURy9Td7tM5zrS4cxHfgTxbM6J+lYxFbikdZrzU3
	DWCQi0/0PyIanEcT/HkshDjHuWtCOCHJXl4SOPVeopYNQUSDslJG5g=
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:reply-to:to:subject:date:message-id
	:content-type:content-transfer-encoding:mime-version; s=default;
	 bh=61AKKiaYOJKMJS5A4AzwWjvpNQc=; b=IfkGo3Ay6Nm3Km8AZNUL/QYUcJXd
	ZLR0dYidSc3dfnybtVs8ff7wcj4ZuuCM+rT0PWlw257AKRAXlcbK1Ek7AcEkt7F1
	2v/19qKvahENYbHrDDIRG1zbk4siqBviPvl0TkibieKIH+/uoklML/YxuTCfDlJB
	yPq6CspXLkjVKZI=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=
X-HELO: nihcesxwayst01.hub.nih.gov
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;  d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1565815146;  x=1597351146;  h=from:to:subject:date:message-id:   content-transfer-encoding:mime-version;  bh=034Xrva5LOs7LLtuulJ6fUexNIg8LId567cD5xztQJw=;  b=kG1MysOze2GK9pdUMidFA22Npaakm02FIk/Iab+c6ep1ZiDfn9iODK0l   BNNVa1PW7pleGksvAkvwAyVprRTpW0j5wBfe5fvq6UJNn5g5weKJ9VcfB   pj+WWLNlvfG/joWyo0R+B/WxyAH1M9JKoUfyUr/DNMpBIozZXqlxg3I5E   VbBH+zeTAat7OqoVZGjq8T4VP8HVuafKkHH1xcLWUV34E4kJvc6DEoVJD   rZb/ghDGg7axDxdBuKxI7ShoniKyI1rFt0Ddqn6ZK/UpKikjFcoNo1END   dW6I/jwAubv32p+UGf7apX5jypcgcuVVf+90xmHZVkIpZ7zmPdpYFbVSQ   w==;
IronPort-SDR: xZgtQKKJLJ/vao7IdC5ovmStiMKkhWO06iY2D4gBwmFFa4hKQT9afljwdTuybjSQ5MpK75e66h 6GrGCq4+4mrqOgOow9LwaFSM9Ftf2GoCCt7KEtSrghbsMHd67S3Q428ffWzn88md7QmkAO/557 afl5s8KdCV/VTSCPftjPg8Tk2BgaI1su8RV89TJiOPJWNKs+YLazdzHGO3NTdor/Hi15Q6qq7N Bw1VqGC3F93ppQng11VPSe7RVcxwYGhy/DxQ/6e7wt5ehnACMPohE9tWFdWLL6FacqDly1AvaY 1FA=
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/hD0iC5wj0RbayGCo/3JPm4DSxBdGROpRKPUoJPQ6cRQ9oFFRIhApuaKo3/ED6KqxxvB0EhRgcvg4u+vfizOhjr0Evjl5sprbVrK1ElLXUzCWA66ZCFV9djxDkPIFLcy+SkJB7mlLBZRZuMsREc/dYO7gCv6U1aXgOSpVRx0eZsCgkOPwL+7YlZ9i3eND+g8aMGD/RAxhvF4figX7DW76SZN5XKtHIXhDBrJa2V11V4EjuwDsIXPZy/ehTHomRwFw0wlN7sOMnDoZIzDgEAvZ9mj64NfWr3P2w3afQ0A9fI7kWe26MqyXOIRcd5RVatPtN9gO+qcXRg2WFKlLTnug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=034Xrva5LOs7LLtuulJ6fUexNIg8LId567cD5xztQJw=; b=SUTQMjDiX+OxVvz8FPS8RZCpvGWvx5Qsg1bzXHpTpxglN003XNBfUzGxZ02dsay/1oYBUI7CHHrnA5z/cg5tMV27cEUgTxO2b+ag3NR4gUiVEDt/2pOiHrE7flwcezn/kPzJYZ7LOBFZeBcjoYJm1lyv8AUcfGGraMfEDwLI1Az/2fRxOzYKgQkArC1AXLSHnZS2aU9tJDodQml5JW0kdXcv9MouAMTySlogpKKsU8RnytJA5QKvl2UXvi2UEgN9OG5FN0zQgL9cWcAWp+k4urt14kbACQTUnAoNWhccb/FtUeyCM97CaKA5AONP7PwHEkamZRjQ+4w5K6uj+uZyrQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector2-nih-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=034Xrva5LOs7LLtuulJ6fUexNIg8LId567cD5xztQJw=; b=Ts9B6BrqGjQyu+lSi6HyJTGrgPqVJN+5gSoKYMpW5ir4Tkm6ZeTrePm8Qs5VJDFNc7Anp49f0zdDu12H5XyFvE77iJOAx3AWNDAkF1oub/fB6VmTgijs53+Dd5e7KKzd2d7gS5fTgmK0N3qNE983IX4gSRA/2btXf4AVtUuaGVc=
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin@cygwin.com>
Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>
Subject: Re: SMBFS mount's file cannot be made executable
Date: Wed, 14 Aug 2019 20:39:02 +0000
Message-ID: <BN6PR09MB1409241CD7F751EA43E8D0C0A5AD0@BN6PR09MB1409.namprd09.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr@ncbi.nlm.nih.gov;
x-ms-exchange-purlcount: 1
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: YZtJgZMZxjSU3VhO6F33QpKcwbjAVy7YEuuE/tMQpQJJzDEApsJ+//ps9PXnpZ5W
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x7EKdfTp027265

> See the '+' at the end of the modes?

I saw that, and I also showed the "getfacl" output for that file and the directory above, which showed
nothing additional.

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

Just take a samba server (4.x) and mount a share with default settings on your Windows box; then
try to change the execute permissions for files in there from Cygwin's shell, using chmod -- the simplest.

> 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.

That is completely untrue;  the underlying filesystem is still controlled by the OS (Windows) in either case.
When the "x" permission is set from under Cygwin, it has to get converted (inside the Cygwin dll) to an appropriate
DAC for the native file system layer.  That DAC is then sent to the samba server (in case of the smb filesystem),
which then either converts it back to the "x" permission (when the SMBD is on Linux) or stores it on the target
filesystem, if that's a Windows box.

And it works the similar way in the reverse:  when a file stat is requested from Cygwin, the SMBD gets the "x" bit,
converts it to SMB response (native for Windows DAC for "execute") and sends it back to Windows box,
which is then read by Cygwin DLL and gets shown as "x" bit in the POSIX mode.  When I just use the file properties
dialog, I bypass only one step in the chains I just described, Cygwin DLL.  And it works by setting the "x" bit
on the server side (Linux).  So, that's how I know that something's off in how Cygwin treats that "x" permission
when asked to set it on a file.

When Windows is about to run an .exe file, it consults the filesystem whether the execute DAC is set.
In case of SMBD 4.x, the filesystem will respond "Access denied" if the "x" permission is not found.
It used to say "okay" in the previous versions.  I quoted the report:

https://forge.univention.org/bugzilla/show_bug.cgi?id=33785

So when I asked my Systems guys that the share to be exported with 

acl allow execute always = True

I can now execute any files (even those whose "x" bits are not set at all! -- SMBD clears everything to execute,
which is madness).  Well, that works around the issue for me, but the question remains as to why when "chmod +x" is given,
Cygwin does not cause the "x" permission to be set on the target file if that file resides on smbfs.
I suspect there are no provisions in code to do that, but I may be wrong.


--
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


