[EXTERNAL] Re: SMBFS mount's file cannot be made executable
Lavrentiev, Anton (NIH/NLM/NCBI) [C]
lavr@ncbi.nlm.nih.gov
Fri Nov 8 16:07:11 GMT 2024
I had the issue at work and I asked my Systems team to configure the share correctly on the Linux side of the things.
Y: on /cygdrive/y type smbfs (binary,posix=0,user,noumount,auto)
Z: on /cygdrive/z type smbfs (binary,posix=0,user,noumount,auto)
The Z: drive is the "default share", and on which the .exe files are not executable.
$ pwd
/cygdrive/z
$ cat hello.c
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
$ gcc -o helloZ hello.c
$ ./helloZ
-bash: ./helloZ: Permission denied
The Y: drive is the same directory on Linux, exported a bit differently:
$ cd /cygdrive/y
$ gcc -o helloY hello.c
$ ./helloY
Hello world!
$ strip hello{Y,Z}
$ diff hello{Y,Z}
$
This is how the Y: drive had been exported from Linux (ours it an AD environment too, BTW):
$ tail -n 6 /etc/samba/smb.conf
[lavr]
path = /export/home/lavr
comment = Anton's Local Home Directory
read only = No
hosts allow = [:snipped:]
acl allow execute always = True
HTH,
Anton Lavrentiev
Contractor NIH/NLM/NCBI
> -----Original Message-----
> From: Takashi Yano <takashi.yano@nifty.ne.jp>
> Sent: Friday, November 08, 2024 6:51 AM
> To: cygwin@cygwin.com
> Cc: Lavrentiev, Anton (NIH/NLM/NCBI) [C] <lavr@ncbi.nlm.nih.gov>
> Subject: [EXTERNAL] Re: SMBFS mount's file cannot be made executable
>
> 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)
> >
> > $ cd /cygdrive/z
> >
> > $ pwd
> > /cygdrive/z
> >
> > $ cat a.c
> > #include <stdio.h>
> >
> > int main()
> > {
> > printf("Hello world!\n");
> > return 0;
> > }
> >
> > $ gcc -Wall a.c
> >
> > $ echo $?
> > 0
> >
> > $ ./a.exe
> > -bash: ./a.exe: Permission denied
> >
> > $ ls -l a.exe
> > -rw-rw-r--+ 1 lavr cppcore 157753 Aug 8 11:29 a.exe
> >
> > $ getfacl.exe a.exe
> > # file: a.exe
> > # owner: lavr
> > # group: cppcore
> > user::rw-
> > user:lavr:rw-
> > group::r--
> > group:cppcore:r--
> > mask::rw-
> > other::r--
> >
> > $ chmod a+x a.exe
> >
> > $ echo $?
> > 0
> >
> > $ ls -l a.exe
> > -rw-rw-r--+ 1 lavr cppcore 157753 Aug 8 11:29 a.exe
> >
> > $ getfacl.exe a.exe
> > # file: a.exe
> > # owner: lavr
> > # group: cppcore
> > user::rw-
> > user:lavr:rw-
> > group::r--
> > group:cppcore:r--
> > mask::rw-
> > other::r--
> >
> > $ ./a.exe
> > -bash: ./a.exe: Permission denied
> >
> > What's missing? How to make the file executable, and why chmod() lies about all-good when
> it does nothing?
> > Any ideas please?
> >
> > Thanks!
> >
> > P.S. I have another netmount "drive" (U:) which Cygwin identifies as "netapp", and
> everything works on that drive,
> > regarding the execution permission.
> >
> > U: on /cygdrive/u type netapp (binary,posix=0,user,noumount,auto)
> >
> > Also, any file that I give the "x" permission from outside Cygwin (e.g. from Linux) on the
> SMBFS drive "Z:",
> > becomes executable:
> >
> > Cygwin> $ gcc -Wall a.c
> >
> > Linux> $ chmod a+x a.exe
> >
> > Cygwin> $ ./a.exe
> > Hello world!
>
> Does anyone know what was the conclusion of this issue?
> I have encountered the same issue and cannot find the
> solution so far.
>
>
> --
> Takashi Yano <takashi.yano@nifty.ne.jp>
> CAUTION: This email originated from outside of the organization. Do not click links or open
> attachments unless you recognize the sender and are confident the content is safe.
More information about the Cygwin
mailing list