I'm not sure if this is the best Stack Exchange to use, but the question concerns Mac, Linux and Samba.
I have a new-to-me Apple Macintosh laptop (MacOS 10.15.7 (Catalina)) and I am have set up Samba (fairly standard changes to /etc/samba/smb.conf) to make files on my Ubuntu Mate (UM) laptop available to my Mac. There are no Windows machines in my network.
Copying files from UM to the Mac works. However I have a lot of documents on UM which do not have extensions. If these files are plain text files, then on arrival at the Mac they are treated as executable programs.
(Other file types such as png are treated correctly whether they have an extension or not.)
For example, I have two text files in a folder called test on the UM. The command ls gives:
$ ls -al total 16 drwxrwxr-x 2 bob bob 4096 May 12 22:23 . drwxr-xr-x 3 bob bob 4096 May 12 22:22 .. -rw-rw-r-- 1 bob bob 24 May 12 22:23 test file -rw-rw-r-- 1 bob bob 24 May 12 22:23 test file.txt
Properties show "Allow executing file as program" is off and SELinux context: unknown
On Mac after copying from UM:
% ls -al total 16 drwxr-xr-x 4 bob staff 128 May 13 00:23 . drwxr-xr-x 7 bob staff 224 May 13 00:23 .. -rwx------ 1 bob staff 24 May 12 22:23 test file -rwx------@ 1 bob staff 24 May 12 22:23 test file.txt
Get Info on "test file" says it is Unix executable; double-clicking on it (in Finder) fails in a new terminal window. Get Info on "test file.txt" says it is Plain Text Document; double-clicking on it opens it in TextEdit.
I can open "test file" in TextEdit by right-clicking the file, choosing "Open with..." and finding the TextEdit application, but this is a little tedious.
Are there any downsides to specifying always open executables in TextEdit? Alternatively, is there a way to automatically make the Mac know that these files arriving from Samba are Plain Text?