all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tramp 2.1.13-pre messed up symbolic link?
@ 2008-06-19  7:56 Yang Zhang
  2008-06-19 10:19 ` Peter Dyballa
       [not found] ` <mailman.13566.1213870789.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Yang Zhang @ 2008-06-19  7:56 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I discovered a problem with tramp. Basically I am using emacs 
23.0.60.1 on my Ubuntu 8.04 Linux machine (with kernel version 
2.6.24-19-generic) with the pre-installed tramp package 2.1.13-pre. I use 
this to edit files on a remote machine (running Solaris 10).

Tramp seemed to have messed up the symbolic links. For example, on the 
remote machine, I have:

test.txt (a normal file)
test_link.txt -> test.txt (a symbolic link to test.txt)

I use my local emacs to open the "test_link.txt" through tramp. Opening 
was fine. But any editing and saving would mess things up. After saving 
changes, the files became:

test.txt is unchanged,
test_link.txt became a normal file and no longer a symbolic link
test_link.txt~ became a symbolic link points to test.txt

A while back, I posted an article here that the emacs on windows vista 
with tramp had the exact problem. At that time, the conclusion was that 
windows does not support unix symbolic link. But this time, it happened to 
my Linux machine, weird??

Anyone have any idea and thoughts?

Thanks
--Yang



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-19  7:56 tramp 2.1.13-pre messed up symbolic link? Yang Zhang
@ 2008-06-19 10:19 ` Peter Dyballa
       [not found] ` <mailman.13566.1213870789.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2008-06-19 10:19 UTC (permalink / raw)
  To: Yang Zhang; +Cc: help-gnu-emacs


Am 19.06.2008 um 09:56 schrieb Yang Zhang:

> A while back, I posted an article here that the emacs on windows  
> vista with tramp had the exact problem. At that time, the  
> conclusion was that windows does not support unix symbolic link.  
> But this time, it happened to my Linux machine, weird??


How about this customisation:

	 '(backup-by-copying-when-linked t)

--
Greetings

   Pete

When confronted with actual numbers, a mathematician is at a loss.
				– Steffen Hokland







^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
       [not found] ` <mailman.13566.1213870789.18990.help-gnu-emacs@gnu.org>
@ 2008-06-20  4:50   ` Yang Zhang
  2008-06-21  8:37     ` Michael Albinus
  0 siblings, 1 reply; 12+ messages in thread
From: Yang Zhang @ 2008-06-20  4:50 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: help-gnu-emacs

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1430 bytes --]

Thanks for your suggestion. It doesn't seem to help, the problem still 
exists. Here is what I found after messing around with different 
configures:

I tried tramp 2.1.9 - 2.1.13 with emacs 23, they all had problem with the 
symbolic link. I also tried several tramp 2.0.x versions, they had problem 
opening the remote file and generated some error messages. I guess they 
don't work with emacs 23.

I also tried to install emacs 22.1 in Ubuntu, which came with tramp 2.0.55 
pre-installed and that worked fine with remote symbolic link files.

I also tried emacs 22.1 with the tramp 2.1.13 and that had the same 
symbolic link problem.

Not sure if it is the tramp's problem, or emacs 23, or both. I'd like to 
use the snapshot emacs version 23 because I can use antialiased fonts 
and that looked really nice.

--Yang

On Thu, 19 Jun 2008, Peter Dyballa wrote:

>
> Am 19.06.2008 um 09:56 schrieb Yang Zhang:
>
>> A while back, I posted an article here that the emacs on windows vista with 
>> tramp had the exact problem. At that time, the conclusion was that windows 
>> does not support unix symbolic link. But this time, it happened to my Linux 
>> machine, weird??
>
>
> How about this customisation:
>
> 	 '(backup-by-copying-when-linked t)
>
> --
> Greetings
>
> Pete
>
> When confronted with actual numbers, a mathematician is at a loss.
> 				– Steffen Hokland
>
>
>
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-20  4:50   ` Yang Zhang
@ 2008-06-21  8:37     ` Michael Albinus
       [not found]       ` <8d61170c0806220203h75885df3nf6283e13c6d3732c@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2008-06-21  8:37 UTC (permalink / raw)
  To: Yang Zhang; +Cc: help-gnu-emacs

Yang Zhang <fz15@HPC.MsState.Edu> writes:

> Not sure if it is the tramp's problem, or emacs 23, or both. I'd like
> to use the snapshot emacs version 23 because I can use antialiased
> fonts and that looked really nice.

I cannot reproduce your problem here (I'm also running Ubuntu
8.04). Could you, please, start Emacs 23 with

  emacs -Q

No further settings needed; Tramp 2.1 is included there. Then rerun your
test.

If there is still a problem, please apply (setq tramp-verbose 9) before
running the test. As usual, I would need to see Tramp's debug buffer.

> --Yang

Best regards, Michael.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
       [not found]       ` <8d61170c0806220203h75885df3nf6283e13c6d3732c@mail.gmail.com>
@ 2008-06-23 10:26         ` Michael Albinus
  2008-06-24  5:24           ` Yang Zhang
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2008-06-23 10:26 UTC (permalink / raw)
  To: Yang Zhang; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

"Yang Zhang" <fz15@cse.msstate.edu> writes:

> Hello Michael,

Hi,

> Thank you for your attention and help. The pre-installed tramp
> 2.1.13-pre with my emacs 23.0.60.1 is also having the symbolic
> problem. Here I attached the tramp debug buffer output. The other
> buffer "tramp /scp host*" is empty.

Thanks for the traces, they have been helpful. Please try the appended
patch (towards 2.1.14-pre), it shall fix the problem.

> Thank you very much,
>
> --Yang

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 1025 bytes --]

*** /tmp/tramp.el	Mon Jun 23 12:20:57 2008
--- /tmp/tramp.el20502jTz	Mon Jun 23 12:20:57 2008
***************
*** 6613,6621 ****
    (unless (stringp (nth 8 attr))
      (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
    ;; Convert directory indication bit.
!   (if (string-match "^d" (nth 8 attr))
!       (setcar attr t)
!     (if (and (listp (car attr)) (stringp (caar attr))
  	     (string-match ".+ -> .\\(.+\\)." (caar attr)))
  	(setcar attr (match-string 1 (caar attr)))
        (setcar attr nil)))
--- 6613,6623 ----
    (unless (stringp (nth 8 attr))
      (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
    ;; Convert directory indication bit.
!   (when (string-match "^d" (nth 8 attr))
!     (setcar attr t))
!   ;; Convert symlink from `tramp-handle-file-attributes-with-stat'.
!   (when (consp (car attr))
!     (if (and (stringp (caar attr))
  	     (string-match ".+ -> .\\(.+\\)." (caar attr)))
  	(setcar attr (match-string 1 (caar attr)))
        (setcar attr nil)))

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-23 10:26         ` Michael Albinus
@ 2008-06-24  5:24           ` Yang Zhang
  2008-06-24 15:10             ` Michael Albinus
                               ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yang Zhang @ 2008-06-24  5:24 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Hi Michael,

Thank you for your patch. It worked fine with emacs 23 on Ubuntu 8.04.
I've also tried the patched tramp 2.1.13 with emacs 22.1 on Windows
Vista. It seems that this also allowed the Windows emacs to read and
save symbolic link files correctly on the remote Solaris 10 machine,
except for some initial warning and interactions (I have to type some
"yes" to proceed). In the Windows Vista emacs 22.1, for symbolic links
that point to cvs controlled file, it directly opened the target file
(which is fine).

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?

Thanks
--Yang


On Mon, Jun 23, 2008 at 5:26 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
>> Hello Michael,
>
> Hi,
>
>> Thank you for your attention and help. The pre-installed tramp
>> 2.1.13-pre with my emacs 23.0.60.1 is also having the symbolic
>> problem. Here I attached the tramp debug buffer output. The other
>> buffer "tramp /scp host*" is empty.
>
> Thanks for the traces, they have been helpful. Please try the appended
> patch (towards 2.1.14-pre), it shall fix the problem.
>
>> Thank you very much,
>>
>> --Yang
>
> Best regards, Michael.
>
>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-24  5:24           ` Yang Zhang
@ 2008-06-24 15:10             ` Michael Albinus
  2008-06-25 11:35             ` Michael Albinus
       [not found]             ` <mailman.13825.1214393802.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2008-06-24 15:10 UTC (permalink / raw)
  To: Yang Zhang; +Cc: help-gnu-emacs

"Yang Zhang" <fz15@cse.msstate.edu> 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?

Indeed, there seems to be a remaining bug. I'll see whether I can fix
it next days.

> Thanks
> --Yang

Thanks for reporting, and best regards, Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-24  5:24           ` Yang Zhang
  2008-06-24 15:10             ` Michael Albinus
@ 2008-06-25 11:35             ` Michael Albinus
  2008-06-26  4:31               ` Yang Zhang
       [not found]             ` <mailman.13825.1214393802.18990.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2008-06-25 11:35 UTC (permalink / raw)
  To: Yang Zhang; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

"Yang Zhang" <fz15@cse.msstate.edu> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 836 bytes --]

*** /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."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-25 11:35             ` Michael Albinus
@ 2008-06-26  4:31               ` Yang Zhang
  0 siblings, 0 replies; 12+ messages in thread
From: Yang Zhang @ 2008-06-26  4:31 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Hi Michael,

The latest patch worked fine. Thanks for your prompt "fix." :)

--Yang

On Wed, Jun 25, 2008 at 6:35 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
>> 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.
>
>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
       [not found]             ` <mailman.13825.1214393802.18990.help-gnu-emacs@gnu.org>
@ 2008-06-26 17:20               ` Thr4wn
  2008-06-26 20:43                 ` Yang Zhang
  2008-06-27  7:05                 ` Michael Albinus
  0 siblings, 2 replies; 12+ messages in thread
From: Thr4wn @ 2008-06-26 17:20 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 25, 7:35 am, Michael Albinus <michael.albi...@gmx.de> wrote:
> > 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.
>
>  text_x-patch_part
> 1KDownload

how do I apply the patch?

also, is the second patch the 'newer' one, or am I supposed to apply
the first one as well, because I receive 404 error when I click it.

-Thr4wn


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-26 17:20               ` Thr4wn
@ 2008-06-26 20:43                 ` Yang Zhang
  2008-06-27  7:05                 ` Michael Albinus
  1 sibling, 0 replies; 12+ messages in thread
From: Yang Zhang @ 2008-06-26 20:43 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: TEXT/PLAIN, Size: 703 bytes --]

The two patches are different, you need to apply them both to fix the two 
problems.  The first patches not handling symbolic link files properly; 
the second fixes not setting the file permission properly.

The patches are the changes made in the source code "tramp.el," they are 
text files.  I guess you can use "diff mode" or other things to apply 
them, I just manually changed "tramp.el" according to the patches and 
recompiled it.

I re-attached the first one here.

--Yang

On Thu, 26 Jun 2008, Thr4wn wrote:

> how do I apply the patch?
>
> also, is the second patch the 'newer' one, or am I supposed to apply
> the first one as well, because I receive 404 error when I click it.
>
> -Thr4wn
>

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1050 bytes --]

*** /tmp/tramp.el	Mon Jun 23 12:20:57 2008
--- /tmp/tramp.el20502jTz	Mon Jun 23 12:20:57 2008
***************
*** 6613,6621 ****
    (unless (stringp (nth 8 attr))
      (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
    ;; Convert directory indication bit.
!   (if (string-match "^d" (nth 8 attr))
!       (setcar attr t)
!     (if (and (listp (car attr)) (stringp (caar attr))
  	     (string-match ".+ -> .\\(.+\\)." (caar attr)))
  	(setcar attr (match-string 1 (caar attr)))
        (setcar attr nil)))
--- 6613,6623 ----
    (unless (stringp (nth 8 attr))
      (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
    ;; Convert directory indication bit.
!   (when (string-match "^d" (nth 8 attr))
!     (setcar attr t))
!   ;; Convert symlink from `tramp-handle-file-attributes-with-stat'.
!   (when (consp (car attr))
!     (if (and (stringp (caar attr))
  	     (string-match ".+ -> .\\(.+\\)." (caar attr)))
  	(setcar attr (match-string 1 (caar attr)))
        (setcar attr nil)))

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: tramp 2.1.13-pre messed up symbolic link?
  2008-06-26 17:20               ` Thr4wn
  2008-06-26 20:43                 ` Yang Zhang
@ 2008-06-27  7:05                 ` Michael Albinus
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2008-06-27  7:05 UTC (permalink / raw)
  To: Thr4wn; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

Thr4wn <Seth.A.Bird@gmail.com> writes:

> how do I apply the patch?

Saving the enclosure as file, applying "patch". If you run Emacs for
reading emails, you could use `ediff-patch-file'.

> also, is the second patch the 'newer' one, or am I supposed to apply
> the first one as well, because I receive 404 error when I click it.

Usually, it should. Unfortunately, I have provided *this* patch in the
wrong order, my sloppiness. Sorry for this. I append the patch, again,
in the right order.

> -Thr4wn

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 837 bytes --]

*** /tmp/tramp.el.~1~	Fri Jun 27 09:03:41 2008
--- /tmp/tramp.el	Fri Jun 27 09:03:41 2008
***************
*** 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."
--- 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."

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-06-27  7:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19  7:56 tramp 2.1.13-pre messed up symbolic link? Yang Zhang
2008-06-19 10:19 ` Peter Dyballa
     [not found] ` <mailman.13566.1213870789.18990.help-gnu-emacs@gnu.org>
2008-06-20  4:50   ` Yang Zhang
2008-06-21  8:37     ` Michael Albinus
     [not found]       ` <8d61170c0806220203h75885df3nf6283e13c6d3732c@mail.gmail.com>
2008-06-23 10:26         ` Michael Albinus
2008-06-24  5:24           ` Yang Zhang
2008-06-24 15:10             ` Michael Albinus
2008-06-25 11:35             ` Michael Albinus
2008-06-26  4:31               ` Yang Zhang
     [not found]             ` <mailman.13825.1214393802.18990.help-gnu-emacs@gnu.org>
2008-06-26 17:20               ` Thr4wn
2008-06-26 20:43                 ` Yang Zhang
2008-06-27  7:05                 ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.