]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix up previous server exit directory deletion
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 27 Nov 2020 08:23:53 +0000 (09:23 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 27 Nov 2020 08:23:53 +0000 (09:23 +0100)
* lisp/server.el (server-start): Only delete the server directory
if it's in /tmp (bug#44644).

lisp/server.el

index 1219b0212249d110f2d3d581a247f712cb156e5f..2fd94552ddab1a6a7316088415e07d894a4b88be 100644 (file)
@@ -650,10 +650,15 @@ the `server-process' variable."
              (let (delete-by-moving-to-trash)
                (delete-file server-file)
                ;; Also delete the directory that the server file was
-               ;; created in.  There may be other servers running,
-               ;; too, so this may fail.
-               (ignore-errors
-                 (delete-directory (file-name-directory server-file)))))
+               ;; created in -- but only in /tmp (see bug#44644).
+               ;; There may be other servers running, too, so this may
+               ;; fail.
+               (when (equal (file-name-directory
+                             (directory-file-name
+                              (file-name-directory server-file)))
+                            "/tmp/")
+                 (ignore-errors
+                   (delete-directory (file-name-directory server-file))))))
          (setq server-mode nil) ;; already set by the minor mode code
          (display-warning
           'server