unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly.
@ 2015-04-03  0:31 arakawa
  2015-04-03  5:42 ` bug#20249: tramp: tramp-flush-directory-property loops infinitely Ivan Shmakov
  2015-04-03 16:57 ` bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly Michael Albinus
  0 siblings, 2 replies; 5+ messages in thread
From: arakawa @ 2015-04-03  0:31 UTC (permalink / raw)
  To: 20249

Hi,

When tramp-flush-directory-property called with 'directory' which ends
in slash, directory-file-name removes the trailing slash but
'file-truename' operation doesn't necessarily remove it. In that case,
directory and truename always differ and
tramp-flush-directory-property called infinitely.

Best regards,
Koichi Arakawa

---
 lisp/ChangeLog          | 5 +++++
 lisp/net/tramp-cache.el | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 38e45d0..3f86a43 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-03  Koichi Arakawa  <arakawa@pp.iij4u.or.jp>
+
+	* net/tramp-cache.el (tramp-flush-directory-property): Fix an
+	infinite loop when 'directory' ends in slash.
+
 2015-04-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* abbrev.el (define-abbrev-table): Treat a non-string "docstring" as
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 1e24ea5..a418eb5 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -188,7 +188,8 @@ Remove also properties of all files in subdirectories."
 	 (truename (tramp-get-file-property key directory "file-truename" nil)))
     ;; Remove file properties of symlinks.
     (when (and (stringp truename)
-	       (not (string-equal directory truename)))
+	       (not (string-equal directory truename))
+	       (not (string-equal (concat directory "/") truename)))
       (tramp-flush-directory-property key truename))
     (tramp-message key 8 "%s" directory)
     (maphash
-- 
2.3.4






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

* bug#20249: tramp: tramp-flush-directory-property loops infinitely
  2015-04-03  0:31 bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly arakawa
@ 2015-04-03  5:42 ` Ivan Shmakov
  2015-04-03 16:57 ` bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly Michael Albinus
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Shmakov @ 2015-04-03  5:42 UTC (permalink / raw)
  To: 20249

>>>>> Koichi Arakawa <arakawa@pp.iij4u.or.jp> writes:

[…]

 > @@ -188,7 +188,8 @@ defun tramp-flush-directory-property (key directory)
 >  	 (truename (tramp-get-file-property key directory "file-truename" nil)))
 >      ;; Remove file properties of symlinks.
 >      (when (and (stringp truename)
 > -	       (not (string-equal directory truename)))
 > +	       (not (string-equal directory truename))
 > +	       (not (string-equal (concat directory "/") truename)))
 >        (tramp-flush-directory-property key truename))
 >      (tramp-message key 8 "%s" directory)
 >      (maphash

	I believe the above should use file-name-as-directory instead of
	a plain concat.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A





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

* bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly.
  2015-04-03  0:31 bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly arakawa
  2015-04-03  5:42 ` bug#20249: tramp: tramp-flush-directory-property loops infinitely Ivan Shmakov
@ 2015-04-03 16:57 ` Michael Albinus
  2015-04-03 18:34   ` Koichi Arakawa
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2015-04-03 16:57 UTC (permalink / raw)
  To: arakawa; +Cc: 20249

arakawa@pp.iij4u.or.jp writes:

> Hi,

Hi,

> When tramp-flush-directory-property called with 'directory' which ends
> in slash, directory-file-name removes the trailing slash but
> 'file-truename' operation doesn't necessarily remove it. In that case,
> directory and truename always differ and
> tramp-flush-directory-property called infinitely.

Thanks for the report. tramp-flush-file-property seems also be affected
(but it doesn't recurse indefinitely). I have committed a patch to the
master branch which shall fix all the cases. Could you, please, test it?

> Best regards,
> Koichi Arakawa

Best regards, Michael.





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

* bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly.
  2015-04-03 16:57 ` bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly Michael Albinus
@ 2015-04-03 18:34   ` Koichi Arakawa
  2015-04-03 19:25     ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Koichi Arakawa @ 2015-04-03 18:34 UTC (permalink / raw)
  To: michael.albinus; +Cc: 20249

Hi Michael,

> Thanks for the report. tramp-flush-file-property seems also be affected
> (but it doesn't recurse indefinitely). I have committed a patch to the
> master branch which shall fix all the cases. Could you, please, test it?

Sure. I have tested it and it works fine. Thank you.
-- 
Koichi Arakawa






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

* bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly.
  2015-04-03 18:34   ` Koichi Arakawa
@ 2015-04-03 19:25     ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2015-04-03 19:25 UTC (permalink / raw)
  To: Koichi Arakawa; +Cc: 20249-done

Version: 25.1

"Koichi Arakawa" <arakawa@pp.iij4u.or.jp> writes:

> Hi Michael,

Hi,

>> Thanks for the report. tramp-flush-file-property seems also be affected
>> (but it doesn't recurse indefinitely). I have committed a patch to the
>> master branch which shall fix all the cases. Could you, please, test it?
>
> Sure. I have tested it and it works fine. Thank you.

Thanks for testing. I'm closing the bug.

Best regards, Michael.





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

end of thread, other threads:[~2015-04-03 19:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-03  0:31 bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly arakawa
2015-04-03  5:42 ` bug#20249: tramp: tramp-flush-directory-property loops infinitely Ivan Shmakov
2015-04-03 16:57 ` bug#20249: [PATCH] tramp: tramp-flush-directory-property loops infinitly Michael Albinus
2015-04-03 18:34   ` Koichi Arakawa
2015-04-03 19:25     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).