From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: Weird tramp scp permissions issue with Date: Sat, 8 Nov 2008 13:05:12 -0800 Message-ID: <97F3A065-7FFD-4661-868F-5D9E8724A4E8@digg.com> References: <8C288EF2-E676-4224-9202-37A88D9B60A3@digg.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226178381 10707 80.91.229.12 (8 Nov 2008 21:06:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Nov 2008 21:06:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kevin Rodgers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 08 22:07:22 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kyv1Z-00026d-0O for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Nov 2008 22:07:17 +0100 Original-Received: from localhost ([127.0.0.1]:41282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kyv0R-0002zz-Dd for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Nov 2008 16:06:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kyv07-0002xv-AM for help-gnu-emacs@gnu.org; Sat, 08 Nov 2008 16:05:47 -0500 Original-Received: from [199.232.76.173] (port=56688 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kyv06-0002xk-US for help-gnu-emacs@gnu.org; Sat, 08 Nov 2008 16:05:47 -0500 Original-Received: from mail.digg.com ([64.191.203.36]:57758) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kyv06-0003mx-8v for help-gnu-emacs@gnu.org; Sat, 08 Nov 2008 16:05:46 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 13B40A859DF; Sat, 8 Nov 2008 13:05:44 -0800 (PST) X-Virus-Scanned: amavisd-new at X-Spam-Score: -0.149 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tKKxOGeNEojc; Sat, 8 Nov 2008 13:05:13 -0800 (PST) Original-Received: from [192.168.1.100] (adsl-69-104-245-69.dsl.pltn13.pacbell.net [69.104.245.69]) by mail.digg.com (Postfix) with ESMTP id 4B611A859D1; Sat, 8 Nov 2008 13:05:13 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59584 Archived-At: On Nov 8, 2008, at 12:43 PM, Kevin Rodgers wrote: > Ian Eure wrote: >> Any file I create on a remote host using tramp's scp method gets a >> mode of 0600, rather than the 0644 I would like. If I use the >> (slower) ssh method, the file gets the correct mode. >> What seems to be happening is that the local file gets created with >> 0600, which is preserved when it's SCP'd over. Indeed, 'tramp- >> methods shows that the `-p' argument is passed to scp, which does >> exactly this. >> My umask is 0022 on both ends, which is correct. So tramp seems to >> be creating the file with 0600 before it copies it. >> Does anyone know how I can fix this? > > ,----[ C-h f default-file-modes RET ] > ,----[ C-h f set-default-file-modes RET ] > > For the familiar octal notation: > > (format "%03o" (default-file-modes)) > This shows the default mode is "755", not 0600. If this were the source of the problem, all files created with Emacs would be created with that mode, not just ones with Tramp. Files created locally, or on a remote machine via the ssh method get the correct (0644) mode. Only files created on a remote machine with the scp method get mode 0600. Digging through tramp.el, I found: tramp-set-auto-save-file-modes, "Set permissions of autosaved remote files to the original permissions." It has a hard-coded "0600" in it, and this is the only place I see any specific permissions in the Tramp source. I changed that to 0644, and eval'd the function. It didn't change anything, I still get the same behavior. - Ian