tramp-devel
[Top][All Lists]
Advanced

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

Re: Problem with Tramp 2.5.2 (with emacs 28.1) when talking to Solaris


From: Simon Matthews
Subject: Re: Problem with Tramp 2.5.2 (with emacs 28.1) when talking to Solaris
Date: Tue, 26 Apr 2022 17:07:34 +0100

* Michael Albinus (michael.albinus@gmx.de) [220422 14:19]:
> Simon Matthews <spm@flirble.org> writes:
> 
> Hi Simon,
> 
> >> Thanks for the report. Unfortunately, I cannot test on Solaris myself.
> >
> > Oracle provide a VM that can be used for testing at 
> > https://www.oracle.com/solaris/solaris11/downloads/solaris11-vm-templates-downloads.html.
> 
> Thanks. Will see whether I van deploy it.
> 
> >> Before applying "ls -al -w", Tramp checks whether there is an error with
> >> these arguments. So I would like to see what happens there.
> >>
> >> Could you, pls, start "emacs -Q --eval '(setq tramp-verbose 6)'" and
> >> open the remote connection? Play a little bit, opening other
> >> directories. When it fails, pls send the complete debug buffer (as
> >> attachment).
> >
> > Should be attached.
> 
> Hah! Solaris does not report an error when using -w wrongly:
> 
> --8<---------------cut here---------------start------------->8---
> 13:37:37.663445 tramp-send-command (6) # /usr/xpg6/bin/ls --color=never -w 
> -al /dev/null 2>/dev/null; echo tramp_exit_status $?
> 13:37:37.666618 tramp-wait-for-regexp (6) #
> /dev/null
> tramp_exit_status 0
> ///43a09477d4e2f750c7c378c684d8bfb7#$
> --8<---------------cut here---------------end--------------->8---
> 
> Could you please try the appended patch for tramp-sh.el?
> 
> > Simon
> 
> Best regards, Michael.
> 

Just to confirm that the latest git version seems to work without problems.

However checking uname for SunOS does seem quite fragile (eg for Solaris
derivatives like Illumos). An option to disable adding -w or even changing
the test to check that it gets some expected results would be preferred.

Simon

> diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
> index 54fb539a..67f5519b 100644
> --- a/lisp/tramp-sh.el
> +++ b/lisp/tramp-sh.el
> @@ -1189,12 +1189,18 @@ component is used as the target of the symlink."
>           ;; The scripts could fail, for example with huge file size.
>           (tramp-do-file-attributes-with-ls v localname id-format))))))))
> 
> +(defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11"))
> +  "Regexp to determine remote SunOS.")
> +
>  (defun tramp-sh--quoting-style-options (vec)
>    "Quoting style options to be used for VEC."
>    (or
>     (tramp-get-ls-command-with
>      vec "--quoting-style=literal --show-control-chars")
> -   (tramp-get-ls-command-with vec "-w")
> +   ;; ls on Solaris does not return an error in that case.  We've got
> +   ;; reports for "SunOS 5.11" so far.
> +   (unless (tramp-check-remote-uname vec tramp-sunos-unames)
> +     (tramp-get-ls-command-with vec "-w"))
>     ""))
> 
>  (defun tramp-do-file-attributes-with-ls (vec localname &optional id-format)
> @@ -3990,9 +3996,6 @@ Returns the exit code of the `test' program."
>        switch
>        (tramp-shell-quote-argument localname)))))
> 
> -(defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11"))
> -  "Regexp to determine remote SunOS.")
> -
>  (defun tramp-find-executable
>    (vec progname dirlist &optional ignore-tilde ignore-path)
>    "Search for PROGNAME in $PATH and all directories mentioned in DIRLIST.




reply via email to

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