Commit dca22e86 authored by Michael Albinus's avatar Michael Albinus

Introduce a defstruct `tramp-file-name' as central data structure.

This solves also Bug#27009.

* lisp/net/tramp.el (tramp-current-domain)
(tramp-current-port): New defvars.
(tramp-file-name): New defstruct.
(tramp-file-name-user-domain, tramp-file-name-host-port)
(tramp-file-name-equal-p): New defuns.
(tramp-file-name-p, tramp-file-name-method)
(tramp-file-name-user, tramp-file-name-host)
(tramp-file-name-localname, tramp-file-name-hop)
(tramp-file-name-real-user, tramp-file-name-domain)
(tramp-file-name-real-host, tramp-file-name-port):
Remove defuns.  They are provided by the defstruct, or not
needed anymore.
(tramp-dissect-file-name, tramp-buffer-name)
(tramp-make-tramp-file-name, tramp-get-buffer)
(tramp-set-connection-local-variables)
(tramp-debug-buffer-name, tramp-message)
(tramp-error-with-buffer, with-parsed-tramp-file-name)
(tramp-completion-dissect-file-name1)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-handle-file-remote-p, tramp-handle-file-symlink-p)
(tramp-handle-find-backup-file-name)
(tramp-handle-insert-file-contents, tramp-process-actions)
(tramp-check-cached-permissions, tramp-local-host-p)
(tramp-get-remote-tmpdir, tramp-call-process)
(tramp-call-process-region, tramp-read-passwd)
(tramp-clear-passwd):
* lisp/net/tramp-adb.el (tramp-adb-parse-device-names)
(tramp-adb-handle-expand-file-name)
(tramp-adb-handle-file-truename, tramp-adb-handle-copy-file)
(tramp-adb-handle-process-file)
(tramp-adb-maybe-open-connection):
* lisp/net/tramp-cache.el (tramp-get-hash-table)
(tramp-get-file-property, tramp-set-file-property)
(tramp-flush-file-property, tramp-flush-directory-property)
(tramp-get-connection-property)
(tramp-set-connection-property, tramp-connection-property-p)
(tramp-flush-connection-property, tramp-cache-print)
(tramp-list-connections, tramp-dump-connection-properties)
(tramp-parse-connection-properties):
* lisp/net/tramp-cmds.el (tramp-cleanup-connection):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-url-file-name, tramp-gvfs-handler-askpassword)
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-mount-spec, tramp-gvfs-get-remote-uid)
(tramp-gvfs-get-remote-gid)
(tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-expand-file-name)
(tramp-sh-handle-start-file-process)
(tramp-sh-handle-process-file, tramp-compute-multi-hops)
(tramp-maybe-open-connection)
(tramp-make-copy-program-file-name, tramp-get-remote-path)
(tramp-get-inline-coding):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-expand-file-name)
(tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
(tramp-smb-handle-set-file-acl)
(tramp-smb-maybe-open-connection): Adapt according to defstruct.
parent 08f00c01
......@@ -199,8 +199,9 @@ pass to the OPERATION."
;; That's why we use `start-process'.
(let ((p (start-process
tramp-adb-program (current-buffer) tramp-adb-program "devices"))
(v (vector tramp-adb-method tramp-current-user
tramp-current-host nil nil))
(v (tramp-make-tramp-file-name
tramp-adb-method tramp-current-user nil
tramp-current-host nil nil nil))
result)
(tramp-message v 6 "%s" (mapconcat 'identity (process-command p) " "))
(process-put p 'adjust-window-size-function 'ignore)
......@@ -242,7 +243,7 @@ pass to the OPERATION."
;; be problems with UNC shares or Cygwin mounts.
(let ((default-directory (tramp-compat-temporary-file-directory)))
(tramp-make-tramp-file-name
method user host
method user domain host port
(tramp-drop-volume-letter
(tramp-run-real-handler
'expand-file-name (list localname))))))))
......@@ -261,7 +262,7 @@ pass to the OPERATION."
"%s%s"
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name
method user host
method user domain host port
(with-tramp-file-property v localname "file-truename"
(let ((result nil)) ; result steps in reverse order
(tramp-message v 4 "Finding true name for `%s'" filename)
......@@ -289,7 +290,7 @@ pass to the OPERATION."
(tramp-compat-file-attribute-type
(file-attributes
(tramp-make-tramp-file-name
method user host
method user domain host port
(mapconcat 'identity
(append '("")
(reverse result)
......@@ -687,7 +688,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
newname (expand-file-name newname))
(if (file-directory-p filename)
(tramp-file-name-handler 'copy-directory filename newname keep-date t)
(copy-directory filename newname keep-date t)
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname)))
......@@ -815,7 +816,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq input (with-parsed-tramp-file-name infile nil localname))
;; INFILE must be copied to remote host.
(setq input (tramp-make-tramp-temp-file v)
tmpinput (tramp-make-tramp-file-name method user host input))
tmpinput (tramp-make-tramp-file-name
method user domain host port input))
(copy-file infile tmpinput t)))
(when input (setq command (format "%s <%s" command input)))
......@@ -849,7 +851,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; file must be deleted after execution.
(setq stderr (tramp-make-tramp-temp-file v)
tmpstderr (tramp-make-tramp-file-name
method user host stderr))))
method user domain host port stderr))))
;; stderr to be discarded.
((null (cadr destination))
(setq stderr "/dev/null"))))
......@@ -1199,8 +1201,7 @@ connection if a previous connection has died for some reason."
(device (tramp-adb-get-device vec)))
;; Set variables for proper tracing in `tramp-adb-parse-device-names'.
(setq tramp-current-method (tramp-file-name-method vec)
tramp-current-user (tramp-file-name-user vec)
(setq tramp-current-user (tramp-file-name-user vec)
tramp-current-host (tramp-file-name-host vec))
;; Maybe we know already that "su" is not supported. We cannot
......
This diff is collapsed.
......@@ -85,7 +85,9 @@ When called interactively, a Tramp connection has to be selected."
(tramp-make-tramp-file-name
(tramp-file-name-method x)
(tramp-file-name-user x)
(tramp-file-name-domain x)
(tramp-file-name-host x)
(tramp-file-name-port x)
(tramp-file-name-localname x)))
(tramp-list-connections)))
name)
......
......@@ -145,7 +145,7 @@ pass to the OPERATION."
((memq operation '(file-directory-p file-exists-p))
(if (apply 'ange-ftp-hook-function operation args)
(let ((v (tramp-dissect-file-name (car args) t)))
(aset v 0 tramp-ftp-method)
(setf (tramp-file-name-method v) tramp-ftp-method)
(tramp-set-connection-property v "started" t))
nil))
......
......@@ -807,7 +807,8 @@ file names."
;; If there is a default location, expand tilde.
(when (string-match "\\`\\(~\\)\\(/\\|\\'\\)" localname)
(save-match-data
(tramp-gvfs-maybe-open-connection (vector method user host "/" hop)))
(tramp-gvfs-maybe-open-connection
(tramp-make-tramp-file-name method user domain host port "/" hop)))
(setq localname
(replace-match
(tramp-get-connection-property v "default-location" "~")
......@@ -831,7 +832,7 @@ file names."
;; No tilde characters in file name, do normal
;; `expand-file-name' (this does "/./" and "/../").
(tramp-make-tramp-file-name
method user host
method user domain host port
(tramp-run-real-handler
'expand-file-name (list localname))))))
......@@ -1249,7 +1250,7 @@ file-notify events."
(concat (match-string 2 user) ";" (match-string 1 user))))
(url-parse-make-urlobj
method (and user (url-hexify-string user)) nil
(tramp-file-name-real-host v) (tramp-file-name-port v)
(tramp-file-name-host v) (tramp-file-name-port v)
(and localname (url-hexify-string localname)) nil nil t))
(url-parse-make-urlobj
"file" nil nil nil nil
......@@ -1329,12 +1330,12 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
t ;; password handled.
nil ;; no abort of D-Bus.
password
(tramp-file-name-real-user l)
(tramp-file-name-user l)
domain
nil ;; not anonymous.
0) ;; no password save.
;; No password provided.
(list nil t "" (tramp-file-name-real-user l) domain nil 0)))
(list nil t "" (tramp-file-name-user l) domain nil 0)))
;; When QUIT is raised, we shall return this information to D-Bus.
(quit (list nil t "" "" "" nil 0)))))
......@@ -1420,7 +1421,7 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
(unless (zerop (length port))
(setq host (concat host tramp-prefix-port-format port)))
(with-parsed-tramp-file-name
(tramp-make-tramp-file-name method user host "") nil
(tramp-make-tramp-file-name method user domain host port "") nil
(tramp-message
v 6 "%s %s"
signal-name (tramp-gvfs-stringify-dbus-message mount-info))
......@@ -1533,9 +1534,9 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
(defun tramp-gvfs-mount-spec (vec)
"Return a mount-spec for \"org.gtk.vfs.MountTracker.mountLocation\"."
(let* ((method (tramp-file-name-method vec))
(user (tramp-file-name-real-user vec))
(user (tramp-file-name-user vec))
(domain (tramp-file-name-domain vec))
(host (tramp-file-name-real-host vec))
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(localname (tramp-file-name-unquote-localname vec))
(share (when (string-match "^/?\\([^/]+\\)" localname)
......@@ -1591,7 +1592,9 @@ ID-FORMAT valid values are `string' and `integer'."
(with-tramp-connection-property vec (format "uid-%s" id-format)
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(domain (tramp-file-name-domain vec))
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(localname
(tramp-get-connection-property vec "default-location" nil)))
(cond
......@@ -1599,7 +1602,8 @@ ID-FORMAT valid values are `string' and `integer'."
(localname
(tramp-compat-file-attribute-user-id
(file-attributes
(tramp-make-tramp-file-name method user host localname) id-format)))
(tramp-make-tramp-file-name method user domain host port localname)
id-format)))
((equal id-format 'integer) tramp-unknown-id-integer)
((equal id-format 'string) tramp-unknown-id-string)))))
......@@ -1609,14 +1613,17 @@ ID-FORMAT valid values are `string' and `integer'."
(with-tramp-connection-property vec (format "gid-%s" id-format)
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(domain (tramp-file-name-domain vec))
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(localname
(tramp-get-connection-property vec "default-location" nil)))
(cond
(localname
(tramp-compat-file-attribute-group-id
(file-attributes
(tramp-make-tramp-file-name method user host localname) id-format)))
(tramp-make-tramp-file-name method user domain host port localname)
id-format)))
((equal id-format 'integer) tramp-unknown-id-integer)
((equal id-format 'string) tramp-unknown-id-string)))))
......@@ -1644,11 +1651,13 @@ connection if a previous connection has died for some reason."
(unless (tramp-gvfs-connection-mounted-p vec)
(let* ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(domain (tramp-file-name-domain vec))
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(localname (tramp-file-name-unquote-localname vec))
(object-path
(tramp-gvfs-object-path
(tramp-make-tramp-file-name method user host ""))))
(tramp-make-tramp-file-name method user domain host port ""))))
(when (and (string-equal method "afp")
(string-equal localname "/"))
......
......@@ -1122,7 +1122,7 @@ target of the symlink differ."
"%s%s"
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name
method user host
method user domain host port
(with-tramp-file-property v localname "file-truename"
(let ((result nil) ; result steps in reverse order
(quoted (tramp-compat-file-name-quoted-p localname))
......@@ -1174,7 +1174,7 @@ target of the symlink differ."
(tramp-compat-file-attribute-type
(file-attributes
(tramp-make-tramp-file-name
method user host
method user domain host port
(mapconcat 'identity
(append '("")
(reverse result)
......@@ -2335,7 +2335,7 @@ The method used must be an out-of-band method."
(let* ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname))
(orig-vec (tramp-dissect-file-name (if t1 filename newname)))
copy-program copy-args copy-env copy-keep-date port listener spec
copy-program copy-args copy-env copy-keep-date listener spec
options source target remote-copy-program remote-copy-args)
(with-parsed-tramp-file-name (if t1 filename newname) nil
......@@ -2368,7 +2368,7 @@ The method used must be an out-of-band method."
tramp-current-user (or (tramp-file-name-user v)
(tramp-get-connection-property
v "login-as" nil))
tramp-current-host (tramp-file-name-real-host v))
tramp-current-host (tramp-file-name-host v))
;; Check which ones of source and target are Tramp files.
(setq source (funcall
......@@ -2383,10 +2383,6 @@ The method used must be an out-of-band method."
(tramp-make-copy-program-file-name v)
(tramp-unquote-shell-quote-argument newname)))
;; Check for host and port number.
(setq host (tramp-file-name-real-host v)
port (tramp-file-name-port v))
;; Check for user. There might be an interactive setting.
(setq user (or (tramp-file-name-user v)
(tramp-get-connection-property v "login-as" nil)))
......@@ -2809,7 +2805,7 @@ the result will be a local, non-Tramp, file name."
;; be problems with UNC shares or Cygwin mounts.
(let ((default-directory (tramp-compat-temporary-file-directory)))
(tramp-make-tramp-file-name
method user host
method user domain host port
(tramp-drop-volume-letter
(tramp-run-real-handler
'expand-file-name (list localname)))
......@@ -2861,7 +2857,9 @@ the result will be a local, non-Tramp, file name."
(tramp-make-tramp-file-name
(tramp-file-name-method v)
(tramp-file-name-user v)
(tramp-file-name-domain v)
(tramp-file-name-host v)
(tramp-file-name-port v)
(tramp-file-name-localname v))
tramp-initial-end-of-output))
;; We use as environment the difference to toplevel
......@@ -2999,7 +2997,8 @@ the result will be a local, non-Tramp, file name."
(setq input (with-parsed-tramp-file-name infile nil localname))
;; INFILE must be copied to remote host.
(setq input (tramp-make-tramp-temp-file v)
tmpinput (tramp-make-tramp-file-name method user host input))
tmpinput
(tramp-make-tramp-file-name method user domain host port input))
(copy-file infile tmpinput t)))
(when input (setq command (format "%s <%s" command input)))
......@@ -3033,7 +3032,7 @@ the result will be a local, non-Tramp, file name."
;; file must be deleted after execution.
(setq stderr (tramp-make-tramp-temp-file v)
tmpstderr (tramp-make-tramp-file-name
method user host stderr))))
method user domain host port stderr))))
;; stderr to be discarded.
((null (cadr destination))
(setq stderr "/dev/null"))))
......@@ -4546,7 +4545,7 @@ Goes through the list `tramp-inline-compress-commands'."
;; host name.
(let* ((v (car target-alist))
(method (tramp-file-name-method v))
(host (tramp-file-name-real-host v)))
(host (tramp-file-name-host v)))
(unless
(or
;; There are multi-hops.
......@@ -4623,8 +4622,8 @@ connection if a previous connection has died for some reason."
;; If Tramp opens the same connection within a short time frame,
;; there is a problem. We shall signal this.
(unless (or (tramp-compat-process-live-p p)
(not (equal (butlast (append vec nil) 2)
(car tramp-current-connection)))
(not (tramp-file-name-equal-p
vec (car tramp-current-connection)))
(> (tramp-time-diff
(current-time) (cdr tramp-current-connection))
(or tramp-connection-min-time-diff 0)))
......@@ -4721,8 +4720,7 @@ connection if a previous connection has died for some reason."
(set-process-sentinel p 'tramp-process-sentinel)
(process-put p 'adjust-window-size-function 'ignore)
(set-process-query-on-exit-flag p nil)
(setq tramp-current-connection
(cons (butlast (append vec nil) 2) (current-time))
(setq tramp-current-connection (cons vec (current-time))
tramp-current-host (system-name))
(tramp-message
......@@ -5104,7 +5102,7 @@ Return ATTR."
"Create a file name suitable for `scp', `pscp', or `nc' and workalikes."
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(host (tramp-file-name-real-host vec))
(host (tramp-file-name-host vec))
(localname
(directory-file-name (tramp-file-name-unquote-localname vec))))
(when (string-match tramp-ipv6-regexp host)
......@@ -5218,7 +5216,9 @@ Nonexistent directories are removed from spec."
(tramp-make-tramp-file-name
(tramp-file-name-method vec)
(tramp-file-name-user vec)
(tramp-file-name-domain vec)
(tramp-file-name-host vec)
(tramp-file-name-port vec)
x))
x))
remote-path)))))
......@@ -5636,14 +5636,14 @@ function cell is returned to be applied on a buffer."
(let ((coding-system-for-write 'binary)
(coding-system-for-read 'binary))
(apply
'tramp-call-process-region ,vec (point-min) (point-max)
'tramp-call-process-region ',vec (point-min) (point-max)
(car (split-string ,compress)) t t nil
(cdr (split-string ,compress)))))
`(lambda (beg end)
(let ((coding-system-for-write 'binary)
(coding-system-for-read 'binary))
(apply
'tramp-call-process-region ,vec beg end
'tramp-call-process-region ',vec beg end
(car (split-string ,compress)) t t nil
(cdr (split-string ,compress))))
(,coding (point-min) (point-max)))))
......
......@@ -53,12 +53,6 @@
;; Another guess. We might implement a better check later on.
(tramp-case-insensitive t))))
;; Add a default for `tramp-default-method-alist'. Rule: If there is
;; a domain in USER, it must be the SMB method.
;;;###tramp-autoload
(add-to-list 'tramp-default-method-alist
`(nil ,tramp-prefix-domain-regexp ,tramp-smb-method))
;; Add a default for `tramp-default-user-alist'. Rule: For the SMB method,
;; the anonymous user is chosen.
;;;###tramp-autoload
......@@ -449,15 +443,11 @@ pass to the OPERATION."
(if (not (file-directory-p newname))
(make-directory newname parents))
(setq tramp-current-method (tramp-file-name-method v)
tramp-current-user (tramp-file-name-user v)
tramp-current-host (tramp-file-name-real-host v))
(setq tramp-current-method method
tramp-current-user user
tramp-current-host host)
(let* ((real-user (tramp-file-name-real-user v))
(real-host (tramp-file-name-real-host v))
(domain (tramp-file-name-domain v))
(port (tramp-file-name-port v))
(share (tramp-smb-get-share v))
(let* ((share (tramp-smb-get-share v))
(localname (file-name-as-directory
(replace-regexp-in-string
"\\\\" "/" (tramp-smb-get-localname v))))
......@@ -465,10 +455,10 @@ pass to the OPERATION."
(expand-file-name
tramp-temp-name-prefix
(tramp-compat-temporary-file-directory))))
(args (list (concat "//" real-host "/" share) "-E")))
(args (list (concat "//" host "/" share) "-E")))
(if (not (zerop (length real-user)))
(setq args (append args (list "-U" real-user)))
(if (not (zerop (length user)))
(setq args (append args (list "-U" user)))
(setq args (append args (list "-N"))))
(when domain (setq args (append args (list "-W" domain))))
......@@ -708,7 +698,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq localname
(replace-match
(if (zerop (length (match-string 1 localname)))
(tramp-file-name-real-user v)
user
(match-string 1 localname))
nil nil localname)))
;; Make the file name absolute.
......@@ -717,7 +707,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; No tilde characters in file name, do normal
;; `expand-file-name' (this does "/./" and "/../").
(tramp-make-tramp-file-name
method user host
method user domain host port
(tramp-run-real-handler 'expand-file-name (list localname))))))
(defun tramp-smb-action-get-acl (proc vec)
......@@ -744,21 +734,17 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(with-tramp-file-property v localname "file-acl"
(when (executable-find tramp-smb-acl-program)
(setq tramp-current-method (tramp-file-name-method v)
tramp-current-user (tramp-file-name-user v)
tramp-current-host (tramp-file-name-real-host v))
(setq tramp-current-method method
tramp-current-user user
tramp-current-host host)
(let* ((real-user (tramp-file-name-real-user v))
(real-host (tramp-file-name-real-host v))
(domain (tramp-file-name-domain v))
(port (tramp-file-name-port v))
(share (tramp-smb-get-share v))
(let* ((share (tramp-smb-get-share v))
(localname (replace-regexp-in-string
"\\\\" "/" (tramp-smb-get-localname v)))
(args (list (concat "//" real-host "/" share) "-E")))
(args (list (concat "//" host "/" share) "-E")))
(if (not (zerop (length real-user)))
(setq args (append args (list "-U" real-user)))
(if (not (zerop (length user)))
(setq args (append args (list "-U" user)))
(setq args (append args (list "-N"))))
(when domain (setq args (append args (list "-W" domain))))
......@@ -1179,7 +1165,8 @@ target of the symlink differ."
(setq input (with-parsed-tramp-file-name infile nil localname))
;; INFILE must be copied to remote host.
(setq input (tramp-make-tramp-temp-file v)
tmpinput (tramp-make-tramp-file-name method user host input))
tmpinput
(tramp-make-tramp-file-name method user domain host port input))
(copy-file infile tmpinput t))
;; Transform input into a filename powershell does understand.
(setq input (format "//%s%s" host input)))
......@@ -1337,24 +1324,20 @@ target of the symlink differ."
(ignore-errors
(with-parsed-tramp-file-name filename nil
(when (and (stringp acl-string) (executable-find tramp-smb-acl-program))
(setq tramp-current-method (tramp-file-name-method v)
tramp-current-user (tramp-file-name-user v)
tramp-current-host (tramp-file-name-real-host v))
(setq tramp-current-method method
tramp-current-user user
tramp-current-host host)
(tramp-set-file-property v localname "file-acl" 'undef)
(let* ((real-user (tramp-file-name-real-user v))
(real-host (tramp-file-name-real-host v))
(domain (tramp-file-name-domain v))
(port (tramp-file-name-port v))
(share (tramp-smb-get-share v))
(let* ((share (tramp-smb-get-share v))
(localname (replace-regexp-in-string
"\\\\" "/" (tramp-smb-get-localname v)))
(args (list (concat "//" real-host "/" share) "-E" "-S"
(args (list (concat "//" host "/" share) "-E" "-S"
(replace-regexp-in-string
"\n" "," acl-string))))
(if (not (zerop (length real-user)))
(setq args (append args (list "-U" real-user)))
(if (not (zerop (length user)))
(setq args (append args (list "-U" user)))
(setq args (append args (list "-N"))))
(when domain (setq args (append args (list "-W" domain))))
......@@ -1845,24 +1828,22 @@ If ARGUMENT is non-nil, use it as argument for
(when buf (with-current-buffer buf (erase-buffer)))
(when (and p (processp p)) (delete-process p))
(let* ((user (tramp-file-name-user vec))
(host (tramp-file-name-host vec))
(real-user (tramp-file-name-real-user vec))
(real-host (tramp-file-name-real-host vec))
(domain (tramp-file-name-domain vec))
(port (tramp-file-name-port vec))
(let* ((user (tramp-file-name-user vec))
(host (tramp-file-name-host vec))
(domain (tramp-file-name-domain vec))
(port (tramp-file-name-port vec))
args)
(cond
(argument
(setq args (list (concat "//" real-host))))
(setq args (list (concat "//" host))))
(share
(setq args (list (concat "//" real-host "/" share))))
(setq args (list (concat "//" host "/" share))))
(t
(setq args (list "-g" "-L" real-host ))))
(setq args (list "-g" "-L" host ))))
(if (not (zerop (length real-user)))
(setq args (append args (list "-U" real-user)))
(if (not (zerop (length user)))
(setq args (append args (list "-U" user)))
(setq args (append args (list "-N"))))
(when domain (setq args (append args (list "-W" domain))))
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment