From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: tramp 2.1.13-pre messed up symbolic link? Date: Wed, 25 Jun 2008 13:35:35 +0200 Message-ID: References: <87bq1v18ux.fsf@gmx.de> <8d61170c0806220203h75885df3nf6283e13c6d3732c@mail.gmail.com> <8d61170c0806232224r324a4b0gb1f22fa28ac78e36@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1214393835 13340 80.91.229.12 (25 Jun 2008 11:37:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Jun 2008 11:37:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Yang Zhang" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 25 13:38:00 2008 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 1KBTK1-0005Ja-MJ for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jun 2008 13:37:57 +0200 Original-Received: from localhost ([127.0.0.1]:50158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBTJC-0001yg-5I for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jun 2008 07:37:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KBTIm-0001wE-31 for help-gnu-emacs@gnu.org; Wed, 25 Jun 2008 07:36:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KBTIk-0001vg-JS for help-gnu-emacs@gnu.org; Wed, 25 Jun 2008 07:36:39 -0400 Original-Received: from [199.232.76.173] (port=36274 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBTGR-0001B4-Iq for help-gnu-emacs@gnu.org; Wed, 25 Jun 2008 07:34:15 -0400 Original-Received: from mailrelay2.alcatel.de ([194.113.59.96]:37185) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KBTGR-00063P-8i for help-gnu-emacs@gnu.org; Wed, 25 Jun 2008 07:34:15 -0400 Original-Received: from slbhab.alcatel.de (slbhab.bln.sel.alcatel.de [149.204.63.218]) by mailrelay2.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id m5PBY4D9030289; Wed, 25 Jun 2008 13:34:04 +0200 In-Reply-To: <8d61170c0806232224r324a4b0gb1f22fa28ac78e36@mail.gmail.com> (Yang Zhang's message of "Tue, 24 Jun 2008 00:24:06 -0500") User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux) X-Scanned-By: MIMEDefang 2.57 on 149.204.45.73 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 2) 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:55078 Archived-At: --=-=-= "Yang Zhang" writes: > Hi Michael, Hi Yang, > There is one small issue (that I've noticed for a long time). After > saving, the target file's permission is always set to be "-rwxrwxrwx" > regardless of the original one. For example, the target file is > "test.cc (-rw-------)" the symbolic link is "test_link.cc (always > lrwxrwxrwx)" After opening "test_link.cc" through tramp and saving > something, "test.cc" now has a permission of "-rwxrwxrwx". It there a > way to retain the target file's original permission after saving > through the symbolic link file? Please try the appended patch. It should fix it. > Thanks > --Yang Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** /tmp/tramp.el Wed Jun 25 13:32:11 2008 --- /tmp/tramp.el.~1~ Wed Jun 25 13:32:11 2008 *************** *** 2675,2684 **** (defun tramp-handle-file-modes (filename) "Like `file-modes' for Tramp files." ! (let ((truename (or (file-truename filename) filename))) ! (when (and (stringp truename) (file-exists-p truename)) ! (tramp-mode-string-to-int ! (nth 8 (file-attributes truename)))))) (defun tramp-handle-file-directory-p (filename) "Like `file-directory-p' for Tramp files." --- 2675,2683 ---- (defun tramp-handle-file-modes (filename) "Like `file-modes' for Tramp files." ! (when (file-exists-p filename) ! (tramp-mode-string-to-int ! (nth 8 (file-attributes filename))))) (defun tramp-handle-file-directory-p (filename) "Like `file-directory-p' for Tramp files." --=-=-=--