[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.2.12); Retrieve of links attributes with stat fail when lin

From: Michael Albinus
Subject: Re: tramp (2.2.12); Retrieve of links attributes with stat fail when link contains two slashes.
Date: Thu, 20 Aug 2015 10:38:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

address@hidden (Pierre Téchoueyres) writes:

>       Hello everybody,

Hi Pierre,

> After digging into the traces (thanks to `tramp-verbose'), I've found
> `tramp-do-file-attributes-with-stat' and
> `tramp-do-directory-files-and-attributes-with-stat'.
> On each of theses functions a replace of // is done.
> But this is done to workaround a bug in pdks on Opsware and I can't test
> it.
> The workaround I propose is to replace the //%N// of the stat command by
> **%N**. I thing it's impossible to create a link with stars (*) in name.

Oh, it's possible:

# touch /tmp/\*\*tmp\*\*
# ln -s /tmp/\*\*tmp\*\* /tmp/\*\*\*tmp\*\*\*
# ls -al /tmp/*tmp*
lrwxrwxrwx 1 albinus albinus   12 Aug 20 10:00 /tmp/***tmp*** -> /tmp/**tmp**
-rw-rw-r-- 1 albinus albinus    0 Aug 20 10:00 /tmp/**tmp**

And your patch makes the Tramp test suite fail. Try

# make check

The problem is, that in function `tramp--test-special-characters' the
file "*foo*bar*baz*" is checked. With your mask "**", the stat command
temporarily returns "***foo*bar*baz***", Tramp cannot decide safely,
which of the "**" characters has to be replaced in sed.

So we would need another mask, which won't appear most likely in the
file name. Maybe you play with generating an arbitrary string, as
`tramp-end-of-heredoc' does?

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]