diff options
| author | Sean Whitton | 2025-11-30 11:24:32 +0000 |
|---|---|---|
| committer | Sean Whitton | 2025-11-30 11:24:32 +0000 |
| commit | 7d2e22843f7cf7a4c5f2bbaef3209f2bbb00ca6c (patch) | |
| tree | 042f6b20ee654a94a0ce6271c58b60e0df13e72f /lisp/server.el | |
| parent | b208b08371044f5c932eb67d85c2a98cc63691b2 (diff) | |
| download | emacs-7d2e22843f7cf7a4c5f2bbaef3209f2bbb00ca6c.tar.gz emacs-7d2e22843f7cf7a4c5f2bbaef3209f2bbb00ca6c.zip | |
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>.
Diffstat (limited to 'lisp/server.el')
| -rw-r--r-- | lisp/server.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/server.el b/lisp/server.el index ca6f9e2448b..d84f17bdfe5 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -1202,9 +1202,12 @@ The following commands are accepted by the client: | |||
| 1202 | 1202 | ||
| 1203 | (cl-defun server--process-filter-1 (proc string) | 1203 | (cl-defun server--process-filter-1 (proc string) |
| 1204 | (server-log (concat "Received " string) proc) | 1204 | (server-log (concat "Received " string) proc) |
| 1205 | ;; First things first: let's check the authentication | 1205 | ;; First things first: let's check the authentication. |
| 1206 | ;; It is important that we strip the trailing space or newline | ||
| 1207 | ;; character in order that it does not appear, to the code below, | ||
| 1208 | ;; there there is a zero-length argument there (bug#79889). | ||
| 1206 | (unless (process-get proc :authenticated) | 1209 | (unless (process-get proc :authenticated) |
| 1207 | (if (and (string-match "-auth \\([!-~]+\\)\n?" string) | 1210 | (if (and (string-match "-auth \\([!-~]+\\)[ \n]?" string) |
| 1208 | (equal (match-string 1 string) (process-get proc :auth-key))) | 1211 | (equal (match-string 1 string) (process-get proc :auth-key))) |
| 1209 | (progn | 1212 | (progn |
| 1210 | (setq string (substring string (match-end 0))) | 1213 | (setq string (substring string (match-end 0))) |