Subject: Re: bug#37884: 27.0.50; Cannot write to a file in VirtualBox shared directory

From: Eli Zaretskii <[email-masked]>
Date: Sun, 27 Oct 2019 18:34:06 +0200

> From: Robert Pluim <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 27 Oct 2019 17:01:11 +0100
> 
>     >> Eli, if the results come back that using 0664 or similar on lockfiles
>     >> resolves this, would you be amenable to such a change?
> 
>     Eli> I'm not sure I understand the proposal.  Is the suggestion to chmod
>     Eli> the file to 0644 before calling unlink?
> 
> Yes, although of course this is assuming it works, one other option
> could be to just not mess with the file's permissions at all when
> initially creating the lockfile.

AFAIU, the problem is with removing the file?  If so, I'd suggest to
do what w32.c does: call unlink as we do now, and if it fails, call
chmod to make it writable and try unlink again.  This has an advantage
of not changing anything for filesystems that implement the Posix
semantics.