Author Topic: Files being saved as executable  (Read 3417 times)

rtconsulting

  • New Community Member
  • Posts: 2
  • Hero Points: 0
Files being saved as executable
« on: April 18, 2017, 10:36:55 PM »
I have a strange setup. Most of my development tools are Windows based. However I occasionally need to do builds on a Linux machine. What I've been doing so far is I mount the Linux drive on my Windows machine as a remote share, edit the files using SlickEdit on Windows over the network and then using either SSH or Putty I log into the Linux machine and build.

All of this works fine except I've notice that the files I save with this setup always have the Linux executable bit set (file permission 100755 rather than 100644). This normally doesn't matter except when I try to push changes I've made this way as git preserves the file settings. I end up messing up the file settings in the archive. I have to constantly change the permissions from 100755 back to 100644. This does not happen if the files are local to the Windows machine and I push from my windows machine.

Does anyone know why this is happening and how to stop it? Is there a save option in SlickEdit that I've missed?

Thanks for your help.
Fred

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Files being saved as executable
« Reply #1 on: April 19, 2017, 05:05:00 PM »
I'd guess at first it's something to do with the translation between the windows rights we to the standard unix rights. I don't think we're requesting the "Read and execute" permission when we save files on windows.  (and even then, it's not a given that would be translated to setting the executable bit by the remote filesystem). 

 You said that it doesn't happen if you save them locally and then push them to the linux machine.  Push them how - are you scp'ing them up in that case, or copying them to the mounted file system?

Also, I'm assuming the linux drive is shared via Samba - is that right, or are you using NFS or some other remote file system?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Files being saved as executable
« Reply #2 on: April 19, 2017, 05:35:08 PM »
Using samba on the linux side?
Try looking at /etc/samba/smb.conf

WRT scp: I've found that if the local file is named "foo.exe", when copied to a linux machine the X bit gets set. I didn't find a way to control this explicitly though, other than using "ssh chmod".

Also, http://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes

mwb1100

  • Senior Community Member
  • Posts: 156
  • Hero Points: 13
Re: Files being saved as executable
« Reply #3 on: April 19, 2017, 10:12:12 PM »
This topic might also have information on what samba is doing, why, and how to change the behavior:

  - Why are files in a smbfs mounted share created with executable bit set?

rtconsulting

  • New Community Member
  • Posts: 2
  • Hero Points: 0
Re: Files being saved as executable
« Reply #4 on: April 21, 2017, 06:08:41 PM »
Thank you everyone. I am running samba to export the drive and it was the samba settings. The link posted by msb1100 explained everything. Basically samba is mis-interpreting some old DOS bits for archive, system and hidden as executable for owner/group/world. l
Changing the /etc/samba/smb.conf to include the following lines in the [data] section seems to have fixed my problem.
map archive = no
map system = no
map hidden = no

Thanks again.