tramp-devel
[Top][All Lists]
Advanced

[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: yary
Subject: Re: tramp (2.2.12); Retrieve of links attributes with stat fail when link contains two slashes.
Date: Thu, 20 Aug 2015 09:28:09 -0400

The nul character (ascii 0) is invalid in file/paths for most filesystems and can be safely used as a separator, if elisp strings and sed can handle them then that's the answer.

-y

On Thu, Aug 20, 2015 at 4:38 AM, Michael Albinus <address@hidden> wrote:
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.

_______________________________________________
Tramp-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/tramp-devel


reply via email to

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