mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
server--process-filter-1: Fix stripping -auth argument (bug#79889)
* lisp/server.el (server--process-filter-1): Strip trailing space after -auth argument (bug#79889). Fix due to Richard Copley <rcopley@gmail.com>.
This commit is contained in:
parent
b208b08371
commit
7d2e22843f
1 changed files with 5 additions and 2 deletions
|
|
@ -1202,9 +1202,12 @@ The following commands are accepted by the client:
|
||||||
|
|
||||||
(cl-defun server--process-filter-1 (proc string)
|
(cl-defun server--process-filter-1 (proc string)
|
||||||
(server-log (concat "Received " string) proc)
|
(server-log (concat "Received " string) proc)
|
||||||
;; First things first: let's check the authentication
|
;; First things first: let's check the authentication.
|
||||||
|
;; It is important that we strip the trailing space or newline
|
||||||
|
;; character in order that it does not appear, to the code below,
|
||||||
|
;; there there is a zero-length argument there (bug#79889).
|
||||||
(unless (process-get proc :authenticated)
|
(unless (process-get proc :authenticated)
|
||||||
(if (and (string-match "-auth \\([!-~]+\\)\n?" string)
|
(if (and (string-match "-auth \\([!-~]+\\)[ \n]?" string)
|
||||||
(equal (match-string 1 string) (process-get proc :auth-key)))
|
(equal (match-string 1 string) (process-get proc :auth-key)))
|
||||||
(progn
|
(progn
|
||||||
(setq string (substring string (match-end 0)))
|
(setq string (substring string (match-end 0)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue