summaryrefslogtreecommitdiff
path: root/lisp/server.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2011-03-11 14:19:08 +0200
committerEli Zaretskii <eliz@gnu.org>2011-03-11 14:19:08 +0200
commit2920e68d73e0009f368e817207964efaff751f85 (patch)
tree26c29a20149fc8539acb28ee9237310e311d9c04 /lisp/server.el
parent69cc79e9e067543c5b20adcea1d756f1dd9569dc (diff)
downloademacs-2920e68d73e0009f368e817207964efaff751f85.tar.gz
Fix comparisons of file ownership on MS-Windows for the Administrator user.
lisp/files.el (file-ownership-preserved-p): Pass `integer' as an explicit 2nd argument to `file-attributes'. If the file's owner is the Administrators group on Windows, and the current user is Administrator, consider that a match. lisp/server.el (server-ensure-safe-dir): Consider server directory safe on MS-Windows if its owner is the Administrators group while the current Emacs user is Administrator. Use `=' to compare numerical UIDs, since they could be integers or floats.
Diffstat (limited to 'lisp/server.el')
-rw-r--r--lisp/server.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/server.el b/lisp/server.el
index f62a7c73abc..816a072bf75 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -474,7 +474,13 @@ See variable `server-auth-dir' for details."
(file-name-as-directory dir))
:warning)
(throw :safe t))
- (unless (eql uid (user-uid)) ; is the dir ours?
+ (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))