From d719ea6ad5419bba2b376384c370dc2744dc718f Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 21 Oct 2017 11:52:24 -0400 Subject: [PATCH] Another fix for unsafe directory error message (Bug#865) * lisp/server.el (server-ensure-safe-dir): Put file owner's uid, not current user's for the wrong owner case. Show expanded file name in error message. --- lisp/server.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/server.el b/lisp/server.el index 33800a98682..4c591a5ee7c 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -546,14 +546,15 @@ See variable `server-auth-dir' for details." ;; group recorded as the owner. (/= uid 544) (/= (user-uid) 500))) (format "it is not owned by you (owner = %s (%d))" - (user-full-name (user-uid)) (user-uid))) + (user-full-name uid) uid)) (w32 nil) ; on NTFS? ((/= 0 (logand ?\077 (file-modes dir))) (format "it is accessible by others (%03o)" (file-modes dir))) (t nil)))) (when unsafe - (error "`%s' is not a safe directory because %s" dir unsafe))))) + (error "`%s' is not a safe directory because %s" + (expand-file-name dir) unsafe))))) (defun server-generate-key () "Generate and return a random authentication key. -- 2.39.2