From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#24656: 25.1; Emacs leaves lock files on a CIFS share Date: Tue, 11 Oct 2016 13:15:50 -0700 Organization: UCLA Computer Science Department Message-ID: References: <83bmyse6zb.fsf@gnu.org> <838ttwdx0n.fsf@gnu.org> <83pon7crcl.fsf@gnu.org> <51995fbe-7230-48c4-2744-ad248202a830@cs.ucla.edu> <83d1j6df3i.fsf@gnu.org> <09fc9aec-1a11-6249-36a7-555b23a53cb0@cs.ucla.edu> <837f9eddbn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------5031B49F73BBB2B671149D2D" X-Trace: blaine.gmane.org 1476217272 16525 195.159.176.226 (11 Oct 2016 20:21:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Oct 2016 20:21:12 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Cc: jsynacek@redhat.com, 24656-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 11 22:21:08 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu3Xg-0001ce-4J for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Oct 2016 22:20:52 +0200 Original-Received: from localhost ([::1]:57834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu3Xe-0001SV-Ro for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Oct 2016 16:20:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu3U3-0007OV-0q for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 16:17:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bu3Ty-00085C-SX for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 16:17:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu3Ty-000850-PA for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 16:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bu3Ty-00036g-Ho for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 16:17:02 -0400 Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 20:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 24656 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 24656@debbugs.gnu.org, eggert@cs.ucla.edu, jsynacek@redhat.com Original-Received: via spool by 24656-done@debbugs.gnu.org id=D24656.147621696311865 (code D ref 24656); Tue, 11 Oct 2016 20:17:02 +0000 Original-Received: (at 24656-done) by debbugs.gnu.org; 11 Oct 2016 20:16:03 +0000 Original-Received: from localhost ([127.0.0.1]:52472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu3T1-00035J-E4 for submit@debbugs.gnu.org; Tue, 11 Oct 2016 16:16:03 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu3Sz-00034T-JG for 24656-done@debbugs.gnu.org; Tue, 11 Oct 2016 16:16:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D6829161329; Tue, 11 Oct 2016 13:15:54 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id kqg3mdGdeO87; Tue, 11 Oct 2016 13:15:53 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E14CC161338; Tue, 11 Oct 2016 13:15:53 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id v9sSTpQmizlG; Tue, 11 Oct 2016 13:15:53 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C42531611E6; Tue, 11 Oct 2016 13:15:53 -0700 (PDT) In-Reply-To: <837f9eddbn.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124364 Archived-At: This is a multi-part message in MIME format. --------------5031B49F73BBB2B671149D2D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 10/11/2016 10:07 AM, Eli Zaretskii wrote: > Sounds fine to me. I just tried this on a Windows filesystem, and it > allows that, so Samba should, too. Unfortunately when I looked at the Emacs code more carefully, I found that '..' won't work because it will confuse older Emacs. So will '@'. Come to think of it, changing conventions in this area is likely to break interoperability not only with older Emacs, but also with other programs that attempt to work with Emacs's locking scheme. I looked into Cygwin, and it seems to use U+F022 to represent '"', not ':'. So this is not Cygwin-related. I looked at the original Red Hat bug report, and found that I could reproduce the problem with a simple C program, i.e., without Emacs or Cygwin. It appears to be a Samba bug. I added a comment to that effect to the Red Hat bug report. I installed into Emacs master the attached patch, which should work around the Samba bug without introducing so many interoperability hassles, and am boldly marking the Emacs bug as done. It's not clear to me whether this change is worth backporting into emacs-25, as Emacs has locked files this way for ages. --------------5031B49F73BBB2B671149D2D Content-Type: application/x-patch; name="0001-Work-around-Samba-bug-with-in-symlink-contents.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Work-around-Samba-bug-with-in-symlink-contents.patch" RnJvbSAyZWJjZGMzZDQzNWYwY2U1ZjI3ZTU4MWFkZTNmY2EwOGYwZjU0ZmMyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBUdWUsIDExIE9jdCAyMDE2IDEzOjA2OjQyIC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gV29yayBhcm91bmQgU2FtYmEgYnVnIHdpdGggJzonIGluIHN5bWxpbmsgY29udGVudHMK Ciogc3JjL2ZpbGVsb2NrLmMgKGN1cnJlbnRfbG9ja19vd25lcik6IFdoZW4gcmVhZGluZyB0 aGUgY29udGVudHMKb2YgYSBsb2NrLCB0cmVhdCB0aGUgVVRGLTggZm9yIFUrRjAyMiBhcyBp ZiBpdCB3ZXJlICc6JyAoQnVnIzI0NjU2KS4KLS0tCiBzcmMvZmlsZWxvY2suYyB8IDM1ICsr KysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMjIg aW5zZXJ0aW9ucygrKSwgMTMgZGVsZXRpb25zKC0pCgpkaWZm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yIChsb2NrX2lu Zm9fdHlwZSAqb3duZXIsIGNoYXIgKmxmbmFtZSkKICAgaWYgKGVycm5vID09IEVSQU5HRSkK ICAgICBwaWQgPSAtMTsKIAotICAvKiBBZnRlciB0aGUgYDonLCBpZiB0aGVyZSBpcyBvbmUs IGNvbWVzIHRoZSBib290IHRpbWUuICAqLworICAvKiBBZnRlciB0aGUgJzonIG9yIGVxdWl2 YWxlbnQsIGlmIHRoZXJlIGlzIG9uZSwgY29tZXMgdGhlIGJvb3QgdGltZS4gICovCisgIGNo YXIgKmJvb3QgPSBvd25lci0+Y29sb24gKyAxOwogICBzd2l0Y2ggKG93bmVyLT5jb2xvblsw XSkKICAgICB7CiAgICAgY2FzZSAwOgpAQCAtNTY0LDEwICs1NjQsMTkgQEAgY3VycmVudF9s b2NrX293bmVyIChsb2NrX2luZm9fdHlwZSAqb3duZXIsIGNoYXIgKmxmbmFtZSkKICAgICAg IGxmaW5mb19lbmQgPSBvd25lci0+Y29sb247CiAgICAgICBicmVhazsKIAorICAgIGNhc2Ug J1wzNTcnOgorICAgICAgLyogVHJlYXQgIlwzNTdcMjAwXDI0MiIgKFUrRjAyMiBpbiBVVEYt OCkgYXMgaWYgaXQgd2VyZSAiOiIuCisJIFRoaXMgd29ya3MgYXJvdW5kIGEgYnVnIGluIFNh bWJhLCB3aGljaCBjYW4gbWlzdGFrZW5seQorCSB0cmFuc2xpdGVyYXRlICc6JyB0byBVK0Yw MjIgaW4gc3ltbGluayBjb250ZW50cyAoQnVnIzI0NjU2KS4KKwkgU2VlIDxodHRwczovL2J1 Z3ppbGxhLnJlZGhhdC5jb20vc2hvd19idWcuY2dpP2lkPTEyNzE0MDcjYzg+LiAgKi8KKyAg ICAgIGlmICghIChib290WzBdID09ICdcMjAwJyAmJiBib290WzFdID09ICdcMjQyJykpCisJ cmV0dXJuIC0xOworICAgICAgYm9vdCArPSAyOworICAgICAgLyogRmFsbCB0aHJvdWdoLiAg Ki8KICAgICBjYXNlICc6JzoKLSAgICAgIGlmICghIGNfaXNkaWdpdCAob3duZXItPmNvbG9u WzFdKSkKKyAgICAgIGlmICghIGNfaXNkaWdpdCAoYm9vdFswXSkpCiAJcmV0dXJuIC0xOwot ICAgICAgYm9vdF90aW1lID0gc3RydG9pbWF4IChvd25lci0+Y29sb24gKyAxLCAmbGZpbmZv X2VuZCwgMTApOworICAgICAgYm9vdF90aW1lID0gc3RydG9pbWF4IChib290LCAmbGZpbmZv X2VuZCwgMTApOwogICAgICAgYnJlYWs7CiAKICAgICBkZWZhdWx0OgotLSAKMi43LjQKCg== --------------5031B49F73BBB2B671149D2D--