(replace-regexp-in-string "^tramp-" "" (symbol-name param))))
(if (tramp-connection-property-p vec hash-entry)
;; We use the cached property.
- (tramp-get-connection-property vec hash-entry nil)
+ (tramp-get-connection-property vec hash-entry nil)
;; Use the static value from `tramp-methods'.
(let ((methods-entry
(assoc param (assoc (tramp-file-name-method vec) tramp-methods))))
(tramp-parse-group
(concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)") 1 " \t"))
-;; For su-alike methods it would be desirable to return "root@localhost"
-;; as default. Unfortunately, we have no information whether any user name
-;; has been typed already. So we use `tramp-current-user' as indication,
-;; assuming it is set in `tramp-completion-handle-file-name-all-completions'.
;;;###tramp-autoload
(defun tramp-parse-passwd (filename)
"Return a list of (user host) tuples allowed to access.
Host is always \"localhost\"."
- (if (zerop (length tramp-current-user))
- '(("root" nil))
- (tramp-parse-file filename 'tramp-parse-passwd-group)))
+ (with-tramp-connection-property nil "parse-passwd"
+ (if (executable-find "getent")
+ (with-temp-buffer
+ (when (zerop (tramp-call-process nil "getent" nil t nil "passwd"))
+ (goto-char (point-min))
+ (loop while (not (eobp)) collect
+ (tramp-parse-etc-group-group))))
+ (tramp-parse-file filename 'tramp-parse-passwd-group))))
(defun tramp-parse-passwd-group ()
"Return a (user host) tuple allowed to access.
(defun tramp-parse-etc-group (filename)
"Return a list of (group host) tuples allowed to access.
Host is always \"localhost\"."
- (tramp-parse-file filename 'tramp-parse-etc-group-group))
+ (with-tramp-connection-property nil "parse-group"
+ (if (executable-find "getent")
+ (with-temp-buffer
+ (when (zerop (tramp-call-process nil "getent" nil t nil "group"))
+ (goto-char (point-min))
+ (loop while (not (eobp)) collect
+ (tramp-parse-etc-group-group))))
+ (tramp-parse-file filename 'tramp-parse-etc-group-group))))
(defun tramp-parse-etc-group-group ()
"Return a (group host) tuple allowed to access.
"Return a list of (user host) tuples allowed to access.
User is always nil."
(if (memq system-type '(windows-nt))
- (with-temp-buffer
- (when (zerop (tramp-call-process
- nil "reg" nil t nil "query" registry-or-dirname))
- (goto-char (point-min))
- (loop while (not (eobp)) collect
- (tramp-parse-putty-group registry-or-dirname))))
+ (with-tramp-connection-property nil "parse-putty"
+ (with-temp-buffer
+ (when (zerop (tramp-call-process
+ nil "reg" nil t nil "query" registry-or-dirname))
+ (goto-char (point-min))
+ (loop while (not (eobp)) collect
+ (tramp-parse-putty-group registry-or-dirname)))))
;; UNIX case.
(tramp-parse-shostkeys-sknownhosts
registry-or-dirname (concat "^\\(" tramp-host-regexp "\\)$"))))