emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107955: lisp/server.el (server-en


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107955: lisp/server.el (server-ensure-safe-dir): Simplify.
Date: Fri, 02 Nov 2012 02:28:51 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107955
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Tue 2012-04-17 19:05:22 +0200
message:
  lisp/server.el (server-ensure-safe-dir): Simplify.
modified:
  lisp/ChangeLog
  lisp/server.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-17 03:06:56 +0000
+++ b/lisp/ChangeLog    2012-04-17 17:05:22 +0000
@@ -1,3 +1,7 @@
+2012-04-17  Juanma Barranquero  <address@hidden>
+
+       * server.el (server-ensure-safe-dir): Simplify.
+
 2012-04-17  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/smie.el: Provide smarter auto-filling.

=== modified file 'lisp/server.el'
--- a/lisp/server.el    2012-04-14 12:58:29 +0000
+++ b/lisp/server.el    2012-04-17 17:05:22 +0000
@@ -520,31 +520,27 @@
     ;; Check that it's safe for use.
     (let* ((uid (nth 2 attrs))
           (w32 (eq system-type 'windows-nt))
-          (safe (catch :safe
-                  (unless (eq t (car attrs))   ; is a dir?
-                    (throw :safe nil))
-                  (when (and w32 (zerop uid))  ; on FAT32?
-                    (display-warning
-                     'server
-                     (format "Using `%s' to store Emacs-server authentication 
files.
+          (safe (cond
+                 ((not (eq t (car attrs))) nil)  ; is a dir?
+                 ((and w32 (zerop uid))          ; on FAT32?
+                  (display-warning
+                   'server
+                   (format "Using `%s' to store Emacs-server authentication 
files.
 Directories on FAT32 filesystems are NOT secure against tampering.
 See variable `server-auth-dir' for details."
-                             (file-name-as-directory dir))
-                     :warning)
-                    (throw :safe t))
-                  (unless (or (= uid (user-uid)) ; is the dir ours?
-                              (and w32
-                                   ;; Files created on Windows by
-                                   ;; Administrator (RID=500) have
-                                   ;; the Administrators (RID=544)
-                                   ;; group recorded as the owner.
-                                   (= uid 544) (= (user-uid) 500)))
-                    (throw :safe nil))
-                  (when w32                    ; on NTFS?
-                    (throw :safe t))
-                  (unless (zerop (logand ?\077 (file-modes dir)))
-                    (throw :safe nil))
-                  t)))
+                           (file-name-as-directory dir))
+                   :warning)
+                  t)
+                 ((and (/= uid (user-uid))       ; is the dir ours?
+                       (or (not w32)
+                           ;; Files created on Windows by Administrator
+                           ;; (RID=500) have the Administrators (RID=544)
+                           ;; group recorded as the owner.
+                           (/= uid 544) (/= (user-uid) 500)))
+                  nil)
+                 (w32 t)                         ; on NTFS?
+                 (t                              ; else, check permissions
+                  (zerop (logand ?\077 (file-modes dir)))))))
       (unless safe
        (error "The directory `%s' is unsafe" dir)))))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]