Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
197b6f3c
Commit
197b6f3c
authored
Apr 17, 2012
by
Juanma Barranquero
Browse files
lisp/server.el (server-ensure-safe-dir): Simplify.
parent
d96a4f88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
lisp/ChangeLog
lisp/ChangeLog
+4
-0
lisp/server.el
lisp/server.el
+19
-23
No files found.
lisp/ChangeLog
View file @
197b6f3c
2012-04-17 Juanma Barranquero <lekktu@gmail.com>
* server.el (server-ensure-safe-dir): Simplify.
2012-04-17 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/smie.el: Provide smarter auto-filling.
...
...
lisp/server.el
View file @
197b6f3c
...
...
@@ -520,31 +520,27 @@ Creates the directory if necessary and makes sure:
;; 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
)))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment