diff options
| author | Sam Steingold | 2009-10-06 19:52:15 +0000 |
|---|---|---|
| committer | Sam Steingold | 2009-10-06 19:52:15 +0000 |
| commit | f58f7520cd4b68e9ae5aebe2486d102c45cb6d7b (patch) | |
| tree | bfdaed37ad7e2b19f268a853fa0d57d5e6c38241 | |
| parent | 9972911fda0c29ae1de4ab2d9a7fcac76545c9d1 (diff) | |
| download | emacs-f58f7520cd4b68e9ae5aebe2486d102c45cb6d7b.tar.gz emacs-f58f7520cd4b68e9ae5aebe2486d102c45cb6d7b.zip | |
(tramp-compat-process-running-p): Check that
the comm attribute is present before calling regexp-quote.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77482ef548a..123af6d9613 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-10-06 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * net/tramp-compat.el (tramp-compat-process-running-p): Check that | ||
| 4 | the comm attribute is present before calling regexp-quote. | ||
| 5 | |||
| 1 | 2009-10-06 Juanma Barranquero <lekktu@gmail.com> | 6 | 2009-10-06 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * play/animate.el (animate-string): For good effect, make sure | 8 | * play/animate.el (animate-string): For good effect, make sure |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 258bc2f4de0..57f23df94f3 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -312,15 +312,15 @@ element is not omitted." | |||
| 312 | (dolist (pid (funcall (symbol-function 'list-system-processes)) result) | 312 | (dolist (pid (funcall (symbol-function 'list-system-processes)) result) |
| 313 | (let ((attributes | 313 | (let ((attributes |
| 314 | (funcall (symbol-function 'process-attributes) pid))) | 314 | (funcall (symbol-function 'process-attributes) pid))) |
| 315 | (when | 315 | (when (and (string-equal |
| 316 | (and (string-equal | 316 | (cdr (assoc 'user attributes)) (user-login-name)) |
| 317 | (cdr (assoc 'user attributes)) (user-login-name)) | 317 | (let ((comm (cdr (assoc 'comm attributes)))) |
| 318 | ;; The returned command name could be truncated | 318 | ;; The returned command name could be truncated |
| 319 | ;; to 15 characters. Therefore, we cannot check | 319 | ;; to 15 characters. Therefore, we cannot check |
| 320 | ;; for `string-equal'. | 320 | ;; for `string-equal'. |
| 321 | (string-match | 321 | (and comm (string-match |
| 322 | (concat "^" (regexp-quote (cdr (assoc 'comm attributes)))) | 322 | (concat "^" (regexp-quote comm)) |
| 323 | process-name)) | 323 | process-name)))) |
| 324 | (setq result t)))))) | 324 | (setq result t)))))) |
| 325 | 325 | ||
| 326 | ;; Fallback, if there is no Lisp support yet. | 326 | ;; Fallback, if there is no Lisp support yet. |