unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ange-ftp appears to have trouble with symbolic links to directories
@ 2003-02-01  0:25 Andrew Koenig
  2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Koenig @ 2003-02-01  0:25 UTC (permalink / raw)


I'm running emacs 21.2 under Solaris 2.8.

On another machine (which I will pretend is named "remote", and which
 happens to be Solaris 2.7, but I doubt it matters), I do the
 following:

        cd /tmp
        mkdir test
        echo hello >test/hello
        ln -s /tmp/test foo

So /tmp/foo should be a synonym for /tmp/test.  Indeed, if I now try

        cat /tmp/foo/hello

it prints hello, as it should.


Now, from my local machine, I try to use ange-ftp to read this file,
by visiting  remote:/tmp/foo/hello.  It fails, in the following way:

I can read remote:/tmp just fine; it looks like this (in dired):

  /remote:/tmp:
  total 1714
  drwxrwxrwt  18 sys      sys         2188 Jan 31 19:15 .
  drwxr-xr-x  25 root     root         512 Jul  8  2002 ..

                        ...

  lrwxrwxrwx   1 ark      ark            9 Jan 31 19:15 foo -> /tmp/test

                        ...

  drwxr-xr-x   2 ark      ark          179 Jan 31 19:09 test


I can also /remote:/tmp/test without difficulty, and also
/remote:/tmp/test/hello.  I can even visit /remote:/tmp/foo/hello.

However, if I try to visit /remote:/tmp/foo, it fails:

  /remote:/tmp/foo:
  /remote:/tmp/test: No such file or directory

If it helps, I blew away the *ftp ark@remote* buffer and tried to
visit remote:/tmp/foo; the resulting buffer follows.  Any ideas?



---------------------------------start of buffer------------------------
ftp> open remote
Connected to remote.research.att.com.
220 remote.research.att.com FTP server (SunOS 5.7) ready.
user "ark" Turtle Power!
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 331 Password required for ark.
230 User ark logged in.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> pwd
257 "/export/remote1/homes1/ark" is current directory.
ftp> ls "-al /tmp/." /tmp/ange-ftp5340pV1
227 Entering Passive Mode (135,207,25,94,188,104)
150 ASCII data connection for /bin/ls (135.207.23.117,36326) (0 bytes).

226 ASCII Transfer complete.
ftp> ls "-al /remote:/tmp/." /tmp/ange-ftp5340bfE
227 Entering Passive Mode (135,207,25,94,188,105)
150 ASCII data connection for /bin/ls (135.207.23.117,36327) (0 bytes).

226 ASCII Transfer complete.
ftp> ls "-al /remote:/tmp/test" /tmp/ange-ftp5340opK
227 Entering Passive Mode (135,207,25,94,188,106)
150 ASCII data connection for /bin/ls (135.207.23.117,36328) (0 bytes).

226 ASCII Transfer complete.
ftp> ls "-al /tmp/foo/." /tmp/ange-ftp53401zQ
227 Entering Passive Mode (135,207,25,94,188,107)
150 ASCII data connection for /bin/ls (135.207.23.117,36329) (0 bytes).

226 ASCII Transfer complete.
ftp> quote mdtm /tmp/foo/
500 'MDTM /tmp/foo/': command not understood.
ftp> quote mdtm /tmp/foo/
500 'MDTM /tmp/foo/': command not understood.
ftp> 
--------------------------------- end of buffer ------------------------


-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-01  0:25 ange-ftp appears to have trouble with symbolic links to directories Andrew Koenig
@ 2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
  2003-02-01  4:16   ` Andrew Koenig
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-01  1:10 UTC (permalink / raw)



I seem to remember doing something about a similar problem.
Is there some way you could check if the Emacs CVS code fixes it ?

Wait, I think the patch below was the meat of it, can you try it ?


        Stefan


--- net/ange-ftp.el	2 Jul 2002 19:20:42 -0000	1.37
+++ net/ange-ftp.el	4 Jul 2002 20:37:14 -0000	1.38
@@ -4517,7 +4518,8 @@
 	(if (and (not wildcard)
 		 (setq tem (file-symlink-p (directory-file-name file))))
 	    (ange-ftp-insert-directory
-	     (ange-ftp-replace-name-component file tem)
+	     (ange-ftp-expand-symlink
+	      tem (file-name-directory (directory-file-name file)))
 	     switches wildcard full)
 	  (insert
 	   (if wildcard

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
@ 2003-02-01  4:16   ` Andrew Koenig
  2003-02-03 21:01   ` Andrew Koenig
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Andrew Koenig @ 2003-02-01  4:16 UTC (permalink / raw)


Stefan> Wait, I think the patch below was the meat of it, can you try it ?

Doesn't seem to help.  The relevant code now looks like this:

(defun ange-ftp-insert-directory (file switches &optional wildcard full)
  (save-match-data
    (let ((short (ange-ftp-abbreviate-filename file))
	  (parsed (ange-ftp-ftp-name (expand-file-name file)))
	  tem)
      (if parsed
	  (if (and (not wildcard)
		   (setq tem (file-symlink-p (directory-file-name file))))
	      (ange-ftp-insert-directory
	       (ange-ftp-expand-symlink
		tem (file-name-directory (directory-file-name file)))
	       switches wildcard full)
	    (insert
	     (if wildcard
		 (let ((default-directory (file-name-directory file)))
		   (ange-ftp-ls (file-name-nondirectory file)
				switches nil nil t))
	       (ange-ftp-ls file switches full))))
	       (ange-ftp-real-insert-directory file switches wildcard full)))))

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
  2003-02-01  4:16   ` Andrew Koenig
@ 2003-02-03 21:01   ` Andrew Koenig
  2003-02-03 21:08   ` Andrew Koenig
  2003-02-07 21:47   ` Andrew Koenig
  3 siblings, 0 replies; 7+ messages in thread
From: Andrew Koenig @ 2003-02-03 21:01 UTC (permalink / raw)


Stefan> Wait, I think the patch below was the meat of it, can you try it ?

As noted in my earlier message, it doesn't seem to help.
In answer to the obvious anticipated question, yes I did remember
to byte-compile the file after changing it.

Any other suggestions as to how I might troubleshoot this problem?

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
  2003-02-01  4:16   ` Andrew Koenig
  2003-02-03 21:01   ` Andrew Koenig
@ 2003-02-03 21:08   ` Andrew Koenig
  2003-02-07 21:47   ` Andrew Koenig
  3 siblings, 0 replies; 7+ messages in thread
From: Andrew Koenig @ 2003-02-03 21:08 UTC (permalink / raw)


One more thing: I have just noticed that the problem does not occur when
the symbolic link begins with ..

So, for example:

        $ cd /tmp
        $ rm -f xx
        $ ln -s /home xx

If I now try to use emacs to read /localhost:/tmp/xx, it fails.

        $ rm xx
        $ ln -s ../home xx

Now it succeeds, with or without the patch.

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
                     ` (2 preceding siblings ...)
  2003-02-03 21:08   ` Andrew Koenig
@ 2003-02-07 21:47   ` Andrew Koenig
  2003-02-23 21:15     ` Stefan Monnier
  3 siblings, 1 reply; 7+ messages in thread
From: Andrew Koenig @ 2003-02-07 21:47 UTC (permalink / raw)


Hunting around on google, I found a possible patch:

http://groups.google.com/groups?q=ange-ftp+symbolic+link&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=200004061949.PAA09981%40jik.kamens.brookline.ma.us&rnum=2

Any idea why this would not have been picked up already?  It appears
to be nearly three years old...

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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

* Re: ange-ftp appears to have trouble with symbolic links to directories
  2003-02-07 21:47   ` Andrew Koenig
@ 2003-02-23 21:15     ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2003-02-23 21:15 UTC (permalink / raw)


> Hunting around on google, I found a possible patch:
> 
> http://groups.google.com/groups?q=ange-ftp+symbolic+link&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=200004061949.PAA09981%40jik.kamens.brookline.ma.us&rnum=2
> 
> Any idea why this would not have been picked up already?  It appears
> to be nearly three years old...

This problem has been fixed in the CVS trunk already (tho in a different
way).  I don't think that's the problem you're seeing, tho.

Can you try the patch below instead ?

It's against the already patched version of ange-ftp-insert-directory
(i.e. it's on top of the previous patch I sent).


        Stefan



@@ -4429,7 +4439,8 @@
 	tem)
     (if parsed
 	(if (and (not wildcard)
-		 (setq tem (file-symlink-p (directory-file-name file))))
+		 (stringp (setq tem (ange-ftp-get-file-entry
+				     (directory-file-name file)))))
 	    (ange-ftp-insert-directory
 	     (ange-ftp-expand-symlink
 	      tem (file-name-directory (directory-file-name file)))

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

end of thread, other threads:[~2003-02-23 21:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-01  0:25 ange-ftp appears to have trouble with symbolic links to directories Andrew Koenig
2003-02-01  1:10 ` Stefan Monnier <foo@acm.com>
2003-02-01  4:16   ` Andrew Koenig
2003-02-03 21:01   ` Andrew Koenig
2003-02-03 21:08   ` Andrew Koenig
2003-02-07 21:47   ` Andrew Koenig
2003-02-23 21:15     ` Stefan Monnier

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).