--- Begin Message ---
Subject: |
25.1; Emacs leaves lock files on a CIFS share |
Date: |
Mon, 10 Oct 2016 13:30:24 +0200 |
Emacs leaves lock files on a CIFS share:
1) Setup a simple samba share (/etc/samba/smb.conf):
...
[public]
browsable = yes
guest ok = yes
path = <path to the share>
read only = no
2) Mount it:
# mount -t cifs //<server>/public /mnt/tmp -o guest
3) # echo "hello emacs" > /mnt/tmp/test.txt
4) Fire up emacs -Q and start editing /mnt/tmp/test.txt. This is what I
see on my system:
# ls -la /mnt/tmp/
total 9
drwxrwxrwx+ 2 root root 0 Oct 10 13:21 .
drwxr-xr-x. 1 root root 20 Jul 15 10:33 ..
lrwxrwxrwx. 1 nfsnobody nfsnobody 54 Oct 10 13:21 .#test.txt -> address@hidden
-rw-rw-rw-+ 1 jsynacek users 10 Oct 10 13:16 test.txt
When I save the file and quit emacs, the lock file stays there. It
should be removed. Maybe it's because of the weird 0xF022 sequence in
the file name?
Originally reported at
https://bugzilla.redhat.com/show_bug.cgi?id=1271407.
--
Jan Synacek
Software Engineer, Red Hat
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#24656: 25.1; Emacs leaves lock files on a CIFS share |
Date: |
Tue, 11 Oct 2016 13:15:50 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
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.
0001-Work-around-Samba-bug-with-in-symlink-contents.patch
Description: Source code patch
--- End Message ---