(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
(setq localname (concat "/" localname)))
;; We do not pass "/..".
- (if (string-match "^\\(afp\\|smb\\)$" method)
+ (if (string-match "^\\(afp\\|davs?\\|smb\\)$" method)
(when (string-match "^/[^/]+\\(/\\.\\./?\\)" localname)
(setq localname (replace-match "/" t t localname 1)))
(when (string-match "^/\\.\\./?" localname)
(setq filename (directory-file-name (expand-file-name filename)))
(with-parsed-tramp-file-name filename nil
(setq localname (tramp-compat-file-name-unquote localname))
- (if (or
- (and (string-match "^\\(afp\\|smb\\)$" method)
- (string-match "^/?\\([^/]+\\)$" localname))
- (string-equal localname "/"))
+ (if (or (and (string-match "^\\(afp\\|davs?\\|smb\\)$" method)
+ (string-match "^/?\\([^/]+\\)$" localname))
+ (string-equal localname "/"))
(tramp-gvfs-get-root-attributes filename)
(assoc
(file-name-nondirectory filename)
"Implementation for the \"org.gtk.vfs.MountOperation.askQuestion\" method."
(save-window-excursion
(let ((enable-recursive-minibuffers t)
- choice)
+ (use-dialog-box (and use-dialog-box (null noninteractive)))
+ result)
- (condition-case nil
- (with-parsed-tramp-file-name
- (tramp-gvfs-file-name (dbus-event-path-name last-input-event)) nil
- (tramp-message v 6 "%S %S" message choices)
-
- ;; In theory, there can be several choices. Until now,
- ;; there is only the question whether to accept an unknown
- ;; host signature.
- (with-temp-buffer
- ;; Preserve message for `progress-reporter'.
- (with-temp-message ""
- (insert message)
- (pop-to-buffer (current-buffer))
- (setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1))
- (tramp-message v 6 "%d" choice)))
-
- ;; When the choice is "no", we set a dummy fuse-mountpoint
- ;; in order to leave the timeout.
- (unless (zerop choice)
- (tramp-set-file-property v "/" "fuse-mountpoint" "/"))
-
- (list
- t ;; handled.
- nil ;; no abort of D-Bus.
- choice))
-
- ;; When QUIT is raised, we shall return this information to D-Bus.
- (quit (list nil t 0))))))
+ (with-parsed-tramp-file-name
+ (tramp-gvfs-file-name (dbus-event-path-name last-input-event)) nil
+ (tramp-message v 6 "%S %S" message choices)
+
+ (setq result
+ (condition-case nil
+ (list
+ t ;; handled.
+ nil ;; no abort of D-Bus.
+ (with-tramp-connection-property
+ (tramp-get-connection-process v) message
+ ;; In theory, there can be several choices.
+ ;; Until now, there is only the question whether
+ ;; to accept an unknown host signature.
+ (with-temp-buffer
+ ;; Preserve message for `progress-reporter'.
+ (with-temp-message ""
+ (insert message)
+ (goto-char (point-max))
+ (if noninteractive
+ (message "%s" message)
+ (pop-to-buffer (current-buffer)))
+ (if (yes-or-no-p
+ (concat
+ (buffer-substring
+ (line-beginning-position) (point))
+ " "))
+ 0 1)))))
+
+ ;; When QUIT is raised, we shall return this
+ ;; information to D-Bus.
+ (quit (list nil t 1))))
+
+ (tramp-message v 6 "%s" result)
+
+ ;; When the choice is "no", we set a dummy fuse-mountpoint in
+ ;; order to leave the timeout.
+ (unless (zerop (cl-caddr result))
+ (tramp-set-file-property v "/" "fuse-mountpoint" "/"))
+
+ result))))
(defun tramp-gvfs-handler-mounted-unmounted (mount-info)
"Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and
(string-equal localname "/"))
(tramp-error vec 'file-error "Filename must contain an AFP volume"))
+ (when (and (string-match method "davs?")
+ (string-equal localname "/"))
+ (tramp-error vec 'file-error "Filename must contain a WebDAV share"))
+
(when (and (string-equal method "smb")
(string-equal localname "/"))
(tramp-error vec 'file-error "Filename must contain a Windows share"))