This is the mail archive of the
mailing list for the Cygwin project.
Re: SMBFS mount's file cannot be made executable
- From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin at cygwin dot com>
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Date: Wed, 14 Aug 2019 20:39:02 +0000
- Subject: Re: SMBFS mount's file cannot be made executable
- 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
- 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-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==
- Ironport-sdr: xZgtQKKJLJ/vao7IdC5ovmStiMKkhWO06iY2D4gBwmFFa4hKQT9afljwdTuybjSQ5MpK75e66h 6GrGCq4+4mrqOgOow9LwaFSM9Ftf2GoCCt7KEtSrghbsMHd67S3Q428ffWzn88md7QmkAO/557 afl5s8KdCV/VTSCPftjPg8Tk2BgaI1su8RV89TJiOPJWNKs+YLazdzHGO3NTdor/Hi15Q6qq7N Bw1VqGC3F93ppQng11VPSe7RVcxwYGhy/DxQ/6e7wt5ehnACMPohE9tWFdWLL6FacqDly1AvaY 1FA=
- Reply-to: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr at ncbi dot nlm dot nih dot gov>
> 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
> 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:
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple