Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive)

From: jari <[email-masked]>
Date: Wed, 14 Dec 2011 16:15:21 +0200

On 2011-12-14 07:55, Ken Brown wrote:
| ...
| >> [Eli] or ask the maintainers of the platform to fix that either in the
| >> platform libraries or in platform-specific code in Emacs. I think
| >> that is the right way; adding a user option every time is not, IMNSHO.
| >>
| >> If native Windows and even MS-DOS ports can DTRT with this, then how
| >> come Cygwin cannot?

To recap:

- Cygwin can, but it needs special setup. This setup is not trivial:
  if you intend to use same Windows Mapped Network Drive. If you use
  mount(1), you lose Windows File Manager Integration because paths
  are no longer the same.

- Emacs can't rely on UID, GID on Cygwin to be correct. 

| >The MS-DOS port uses system-specific code in `check_writable' (see
| >fileio.c). I don't know whether the native Windows port DTRT for Jari's
| >network filesystem. Jari, can you test this?

Yes, Windows NT EMacs port works fine. No problems

- File on remote drive are not marked read-only
- File on remote drive are written without asking.

| As I understand it, this is a filesystem problem: Samba returns a
| fake SID to Windows, so Cygwin can't determine the correct uid/gid.

Yes.

| Jari, you were already told on the Cygwin list how to work around
| this problem.  Why not just do it?

It's too complex, and doesn't work with multiple Samaba severs that
would use all different GID, UIDs for the same user name, and I cannot
get right UIDs and GIDs installed ... too many issues.

I can work just fine under Cygwin without these GID, UIDs set. But I
can't use Emacs effectively.

I would expect there to be at least an option to control these
pre-emptive confirmation questions. Without any control, the situation
is a nightmare.

Compare:

      confirm-kill-emacs
      dired-no-confirm
      message-kill-buffer-on-exit
      vc-suppress-confirm
      ...

Jari