[Top][All Lists]

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

Re: Emacs on Windows keeps complaining: the directory ... is unsafe.

From: Óscar Fuentes
Subject: Re: Emacs on Windows keeps complaining: the directory ... is unsafe.
Date: Tue, 26 May 2009 00:42:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

Hello Eli and Juanma.

Eli Zaretskii <address@hidden> writes:

>> Yesterday I refreshed my build of Emacs CVS on a Windows machine after
>> some months and it keeps complaining:
>> error: The directory d:/home/.emacs.d/server is unsafe
>> when calling server-start. I see no references to this problem on News
>> or Known Problems.
> That bug was fixed ages ago.  The test is made only if Emacs runs on
> something other than Windows.  Are you sure you don't have a stale
> server.el somewhere?

I'm sure it is using the server.el installed with `make install`.

BTW, only a part of the test is elided on windows. This is the test

    (unless (and (eq t (car attrs)) (eql (nth 2 attrs) (user-uid))
                 (or (eq system-type 'windows-nt)
                     (zerop (logand ?\077 (file-modes dir)))))
      (error "The directory %s is unsafe" dir))

>> Is there a cure for this? What I did until now is remove the check on
>> server.el, but this is hardly acceptable for the common user.
> What check did you remove, and how did it fail for you?  If none of
> the above helps to solve the problem, please debug it like Juanma
> suggested, and post the results here.
> The first thing I'd look at is whether the owner of that directory (as
> returned by `file-attributes', for example, is the same as what
> `(user-uid)' returns on that system.

Thanks for the hint. This seems the problem:

the file uid returned by file-attributes is 544:

(file-attributes "d:/home/.emacs.d/server")

(t 1 544 513 (18971 5346) (18971 5346) (17735 22234) 0 "drwxrwxrwx" nil
(2360832 0 . 9198) (21721 . 11703))

and (user-uid) returns 500.

The directory is accesible only for Administrator (me). Even tried to
change the directory hierarchy where emacs is installed so only
Administrator can access it. (user-uid) still returns 500.

It's strange too the file modes string: "drwxrwxrwx" This is not
consistent with a directory accessible only by the current user
(Administrator). A cygwin shell shows this:

address@hidden ~
$ ls -l .emacs.d/      
total 1
d---------+ 2 Administrators None   0 May 26 00:31 server
----------+ 1 Administrators None 902 May  7  2008 tramp
d---------+ 2 Administrators None   0 Feb 17  2007 url

Have no idea what's going on.


reply via email to

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