Subject: bug#3712: 23.1.50; SECURITY: Tramp creates -rwxrwxrwx permission files with /su and /sudo method

From: Michael Albinus <[email-masked]>
Date: Tue, 30 Jun 2009 14:21:53 +0200

Teemu Likonen <[email-masked]> writes:

>> Thanks. Otherwise OK but I don't like the fact that it gives executable
>> bits (-rwxr-xr-x) by default. Normal behavior for new files is to drop
>> umask bits _and_ executable bits. Executable must be added explicitly.

When creating a new file, Tramp uses Emacs' default file modes. You can
check them with "M-: (default-file-modes)".

If you want to change them, you could apply for example
"M-: (set-default-file-modes #o0400)". The value is used then for all
newly created files, also for local ones.

> And when editing existing files it should obviously respect the bits
> that the file already has. Currently -- even with this fix -- tramp is
> adding "x" bits at some point because "backup by rename" moves old
> version out of the way and new is created with -rwxr-xr-x bits.

As I said already, I cannot reproduce it. However, there seems to be a
small annoyance in special cases. I've fixed this. Could you, please,
check, whether it is OK now for you?

Best regards, Michael.