Simon Matthews <[email protected]> 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.

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