Subject: Re: bug#865: 23.0.60; The directory is unsafe today

From: Eli Zaretskii <[email-masked]>
Date: Fri, 05 Sep 2008 20:19:42 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: Lennart Borgman <[email-masked]>,
>         [email-masked], [email-masked]
> Date: Fri, 05 Sep 2008 11:34:58 -0400
> 
> > set-file-modes is only very crudely emulated on Windows.  In a
> > nutshell, the underlying primitive _chmod only considers the high 3
> > bits of the argument you pass to set-file-modes.
> 
> So I guess that's pretty much the source of the problem

The source of the problem is that Posix rwxrwxrwx mode bits don't map
well to Windows ACL-based file security.  Even if I would sit down to
rewrite _chmod to preserve Posix semantics, I'd have difficulty doing
that because there's no clear distinction between "group" and "world",
and because the set of Windows access bits is larger than just rwx.
(Cygwin jumps through the hoops to make Posix semantics happen, but
even they require that the user's group be defined for this to work,
and generally that you play by Posix rules.)

Instead of assuming Posix semantics, we should explicitly have a
primitive that creates files that can only be accessed by their
creator; on Posix platforms the implementation could do what we do in
server.el now.