diff options
| author | Michael Albinus | 2018-05-16 11:22:51 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-05-16 11:22:51 +0200 |
| commit | 01120ec3d2eecd11e23f008feed020def7ea0e88 (patch) | |
| tree | 0019f45ca3f7d35d8131abb6733a729e26cf08e9 /lisp/auth-source.el | |
| parent | 4c3cd27df9c0735d907813a8c16a87acc54b9edc (diff) | |
| download | emacs-01120ec3d2eecd11e23f008feed020def7ea0e88.tar.gz emacs-01120ec3d2eecd11e23f008feed020def7ea0e88.zip | |
Fix creation of Secret Service items in auth-source
* lisp/auth-source.el (auth-source-secrets-create): Use ´apply'.
(auth-source-secrets-saver): Handle `auth-source-save-behavior'
equal t.
* lisp/net/secrets.el (secrets-get-items): Do not call
`secrets-open-session' here ...
(top): ... but here.
* test/lisp/auth-source-tests.el
(auth-source-test-secrets-create-secret): Bind
`auth-source-save-behavior' to t. Cleanup.
* test/lisp/net/secrets-tests.el (secrets-test00-availability):
After loading secets.el, a session is already opened.
(secrets-test02-collections, secrets-test03-items)
(secrets-test04-search): Open a new session.
Diffstat (limited to 'lisp/auth-source.el')
| -rw-r--r-- | lisp/auth-source.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 8b54c8118d2..918d785eaef 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el | |||
| @@ -1733,7 +1733,7 @@ authentication tokens: | |||
| 1733 | (secret (plist-get artificial :secret)) | 1733 | (secret (plist-get artificial :secret)) |
| 1734 | (secret (if (functionp secret) (funcall secret) secret))) | 1734 | (secret (if (functionp secret) (funcall secret) secret))) |
| 1735 | (lambda () | 1735 | (lambda () |
| 1736 | (apply 'auth-source-secrets-saver collection item secret args)))) | 1736 | (auth-source-secrets-saver collection item secret args)))) |
| 1737 | 1737 | ||
| 1738 | (list artificial))) | 1738 | (list artificial))) |
| 1739 | 1739 | ||
| @@ -1742,8 +1742,9 @@ authentication tokens: | |||
| 1742 | Respects `auth-source-save-behavior'." | 1742 | Respects `auth-source-save-behavior'." |
| 1743 | (let ((prompt (format "Save auth info to secrets collection %s? " collection)) | 1743 | (let ((prompt (format "Save auth info to secrets collection %s? " collection)) |
| 1744 | (done (not (eq auth-source-save-behavior 'ask))) | 1744 | (done (not (eq auth-source-save-behavior 'ask))) |
| 1745 | (doit (eq auth-source-save-behavior t)) | ||
| 1745 | (bufname "*auth-source Help*") | 1746 | (bufname "*auth-source Help*") |
| 1746 | doit k) | 1747 | k) |
| 1747 | (while (not done) | 1748 | (while (not done) |
| 1748 | (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ??))) | 1749 | (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ??))) |
| 1749 | (cl-case k | 1750 | (cl-case k |