diff options
| author | Michael Albinus | 2008-06-08 11:50:16 +0000 |
|---|---|---|
| committer | Michael Albinus | 2008-06-08 11:50:16 +0000 |
| commit | 43d28dcd432a3d8073a0457f2f7a07808a78f688 (patch) | |
| tree | 64a88eb8321bc7822f2cd25ad1d9c4c0c7f25da9 | |
| parent | 942b4750218f7d4ec160fe9abd026daee9daf7ea (diff) | |
| download | emacs-43d28dcd432a3d8073a0457f2f7a07808a78f688.tar.gz emacs-43d28dcd432a3d8073a0457f2f7a07808a78f688.zip | |
* auth-source.el: Precise Tramp doc.
| -rw-r--r-- | lisp/gnus/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/gnus/auth-source.el | 20 |
2 files changed, 13 insertions, 11 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 892a979bdc1..ca9c09b2f59 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-06-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * auth-source.el: Precise Tramp doc. | ||
| 4 | |||
| 1 | 2008-06-07 Glenn Morris <rgm@gnu.org> | 5 | 2008-06-07 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * nnmairix.el: Remove unnecessary eval-when-compile. | 7 | * nnmairix.el: Remove unnecessary eval-when-compile. |
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index cd8a196d983..a19327e79fb 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el | |||
| @@ -48,14 +48,12 @@ | |||
| 48 | ;;; digest). If you want finer controls, explore the url-auth source | 48 | ;;; digest). If you want finer controls, explore the url-auth source |
| 49 | ;;; code and variables. | 49 | ;;; code and variables. |
| 50 | 50 | ||
| 51 | ;;; (Tramp patch pending for this!) | ||
| 52 | ;;; For tramp authentication, use: | 51 | ;;; For tramp authentication, use: |
| 53 | 52 | ||
| 54 | ;;; machine yourmachine.com port tramp login testuser password testpass | 53 | ;;; machine yourmachine.com port scp login testuser password testpass |
| 55 | 54 | ||
| 56 | ;;; Note that the port can be scp or ssh, for example, to match only | 55 | ;;; Note that the port denotes the Tramp connection method. When you |
| 57 | ;;; those protocols. When you use port = tramp, you match any Tramp | 56 | ;;; don't use a port entry, you match any Tramp method. |
| 58 | ;;; protocol. | ||
| 59 | 57 | ||
| 60 | ;;; Code: | 58 | ;;; Code: |
| 61 | 59 | ||
| @@ -88,7 +86,7 @@ | |||
| 88 | (defconst auth-source-protocols-customize | 86 | (defconst auth-source-protocols-customize |
| 89 | (mapcar (lambda (a) | 87 | (mapcar (lambda (a) |
| 90 | (let ((p (car-safe a))) | 88 | (let ((p (car-safe a))) |
| 91 | (list 'const | 89 | (list 'const |
| 92 | :tag (upcase (symbol-name p)) | 90 | :tag (upcase (symbol-name p)) |
| 93 | p))) | 91 | p))) |
| 94 | auth-source-protocols)) | 92 | auth-source-protocols)) |
| @@ -154,23 +152,23 @@ Returns fallback choices (where PROTOCOL or HOST are nil) with FALLBACK t." | |||
| 154 | 152 | ||
| 155 | (defun auth-source-user-or-password (mode host protocol) | 153 | (defun auth-source-user-or-password (mode host protocol) |
| 156 | "Find user or password (from the string MODE) matching HOST and PROTOCOL." | 154 | "Find user or password (from the string MODE) matching HOST and PROTOCOL." |
| 157 | (gnus-message 9 | 155 | (gnus-message 9 |
| 158 | "auth-source-user-or-password: get %s for %s (%s)" | 156 | "auth-source-user-or-password: get %s for %s (%s)" |
| 159 | mode host protocol) | 157 | mode host protocol) |
| 160 | (let (found) | 158 | (let (found) |
| 161 | (dolist (choice (auth-source-pick host protocol)) | 159 | (dolist (choice (auth-source-pick host protocol)) |
| 162 | (setq found (netrc-machine-user-or-password | 160 | (setq found (netrc-machine-user-or-password |
| 163 | mode | 161 | mode |
| 164 | (plist-get choice :source) | 162 | (plist-get choice :source) |
| 165 | (list host) | 163 | (list host) |
| 166 | (list (format "%s" protocol)) | 164 | (list (format "%s" protocol)) |
| 167 | (auth-source-protocol-defaults protocol))) | 165 | (auth-source-protocol-defaults protocol))) |
| 168 | (when found | 166 | (when found |
| 169 | (gnus-message 9 | 167 | (gnus-message 9 |
| 170 | "auth-source-user-or-password: found %s=%s for %s (%s)" | 168 | "auth-source-user-or-password: found %s=%s for %s (%s)" |
| 171 | mode | 169 | mode |
| 172 | ;; don't show the password | 170 | ;; don't show the password |
| 173 | (if (equal mode "password") "SECRET" found) | 171 | (if (equal mode "password") "SECRET" found) |
| 174 | host protocol) | 172 | host protocol) |
| 175 | (return found))))) | 173 | (return found))))) |
| 176 | 174 | ||