From 289a04cdda74a2481b9b95bc7c235af5b1454256 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 27 Nov 2020 09:23:53 +0100 Subject: [PATCH] Fix up previous server exit directory deletion * lisp/server.el (server-start): Only delete the server directory if it's in /tmp (bug#44644). --- lisp/server.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/server.el b/lisp/server.el index 1219b021224..2fd94552dda 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -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 -- 2.39.5