branch: externals/bluetooth commit 0108cbde29366f88b333152ce31da0e23c1156aa Author: Raffael Stocker <r.stoc...@mnet-mail.de> Commit: Raffael Stocker <r.stoc...@mnet-mail.de>
uses `read-from-minibuffer' instead of `read-passwd' The pin is not encrypted on the bus, so it makes no sense to hide it in the user interface. --- bluetooth.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bluetooth.el b/bluetooth.el index 3123389..2b77d25 100644 --- a/bluetooth.el +++ b/bluetooth.el @@ -440,19 +440,17 @@ This function only uses the first adapter reported by Bluez." (bluetooth--maybe-cancel-reject (bluetooth--with-alias device (save-match-data - (let* ((pin (read-passwd (format "Enter Bluetooth PIN for `%s': " alias))) + (let* ((pin (read-from-minibuffer + (format "Enter Bluetooth PIN for `%s': " alias))) (trimmed-pin (substring pin 0 (min (length pin) 16))) (case-fold-search nil)) - (unwind-protect - (cond ((= 0 (length trimmed-pin)) - (message "PIN has zero length") - nil) - ((string-match "[^[:alnum:]]" trimmed-pin) - (message "PIN contains non-alphanumeric characters") - nil) - (t trimmed-pin)) - (clear-string pin) - (clear-string trimmed-pin))))))) + (cond ((= 0 (length trimmed-pin)) + (message "PIN has zero length") + nil) + ((string-match "[^[:alnum:]]" trimmed-pin) + (message "PIN contains non-alphanumeric characters") + nil) + (t trimmed-pin))))))) (defun bluetooth--display-pin-code (device pincode) "Display the PINCODE for DEVICE."