Before anyone says to turn off the two-stage save, I've already done that. I'm
using jEdit 5.0.0 on Java 1.6.0_30 on Windows 7. Vanilla install, no plugins.
(I renamed my jedit prefs folder specifically to test the bug below.)
When editing a file on a remote samba server, jEdit adjust the file
permissions after each save. It removes the user execute bit. **I have
already turned off the two-stage save.** (See the inode number below.)
The problem is not samba, or the file server as other editors I tried work
correctly. The correct behavior would be leaving the file permissions
exactly as they were.
1. Turn off the two-stage save. Utilities->Options->Saving & Backup.
Un-check Two-stage save. Click Apply/Ok.
2. Make a file on the remote server::
3. Set the permissions to include a user-execute bit::
chmod 777 foo.txt
4. Look at the file's permission. Notice the user-execute bit and inode number::
ls -lhi foo.txt
118582097 -rwxrwxrwx 1 Modulok Modulok 0B Apr 5 02:21 foo.txt
5. Open the file in jEdit. Edit the file and then click File->Save.
6. Bam! jEdit turns off the user-execute bit::
ls -lhi foo.txt
118582097 -rw-rwxrwx 1 Modulok Modulok 2B Apr 5 02:22 foo.txt
The expected result was the permission bits to remain exactly as they were.
Notice the inode number is the same. (Again, the two-stage save is turned off.)
I tried this same test with Notepad. Notepad correctly left the permission bits
as they were. I also edited the file on the server itself with nano, it
correctly left the permissions as they were. The file extension doesn't seem to
matter. (I tried a .txt file and .py file. Same result.)
Can anyone fix this?