Description of problem: Emacs creates a corrupted symlink on a CIFS share when editing a file, and then fails to delete it when closing the file. This doesn't happen for local files. Version-Release number of selected component (if applicable): emacs-24.5-2.fc21.x86_64 kernel-4.1.6-100.fc21.x86_64 How reproducible: always Steps to Reproduce: 1. emacs /path/to/CIFS/mount/foo 2. start making changes 3. look at the .#foo symlink created, it has a funny character between the PID and another large number. 4. Save and exit emacs. 5. The symlink stays behind and is not deleted. Actual results: CIFS share shows a funny character in the symlink: -rw-rw-r--. 1 cra cra 0 Oct 13 18:04 foo lrwxrwxrwx. 1 cra cra 39 Oct 13 2015 .#foo -> cra1441383545 The funny character between 3315 and 1441383545 is "ef 80 a2" in hex: >cat | hexdump -C 00000000 ef 80 a2 0a |....| 00000004 Local file (ext4) shows no funny character: -rw-r-----. 1 cra cra 9 Oct 13 18:04 foo lrwxrwxrwx. 1 cra cra 37 Oct 13 18:09 .#foo -> cra:cra.edu.3346:1441383545 Expected results: No funny character in the symlink content. The symlink should be removed by emacs upon closing the file. Additional info: The CIFS server is Centos 5 running samba-3.0.33-3.40.el5_10.
Correction to Local file (ext4) shows no funny character: -rw-r-----. 1 cra cra 9 Oct 13 18:04 foo lrwxrwxrwx. 1 cra cra 37 Oct 13 18:09 .#foo -> cra:1441383545
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Still an issue with F23. Maybe this is a Samba bug rather than an Emacs bug?
I think this is an Emacs bug. The same problem happens with symlinks on a CIFS share from a samba-3.0.33-3.40.el5_10 EL5 server and also a samba-4.2.3-11.el7_2.x86_64 EL7 server.
Still exists on Fedora 24. emacs-25.0.95-2.fc24.x86_64 kernel-4.6.4-301.fc24.x86_64
This still happens with emacs-25.1-1.fc24.x86_64. You can work around this by turning off interlocking: (setq create-lockfiles nil) Reported at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24656.
This is a bug in Samba, not in Emacs. I can reproduce the bug without Emacs on a CIFS file system (locally mounted, Fedora 24) by running this simple C program: #include <unistd.h> int main (void) { return symlink ("a:b", "f") != 0; } This creates a symbolic link from "f" to "a<F022>b", where "<F022>" stands for the UTF-8 representation for U+F022, i.e., the bytes EF, 80, A2.
The workaround can be found at http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1dd54e3eef7543720eff161457677a35fae2435c.
Since the bug is in Samba, the "Component" field of this bug report should be changed from "emacs" to "samba".
(In reply to Paul Eggert from comment #10) > Since the bug is in Samba, the "Component" field of this bug report should > be changed from "emacs" to "samba". How is using a character that isn't allowed on a specific filesystem considered to be a bug in that filesystem? It seems to me to be an emacs bug to assume that any character is allowed to be used... If emacs tried to use '/' in a filename it wouldn't be considerd a bug in Ext4 would it? Just like '/' is a path separator in Unix filesystems, ':' is a path separator in other filesystems.
(In reply to Charles R. Anderson from comment #11) > How is using a character that isn't allowed on a specific filesystem > considered to be a bug in that filesystem? First, the contents of a symbolic link do not have to be a file name, which means that file system restrictions are irrelevant in symlink contents. I can create a symbolic link from 'foo' to 'a:/never/never/land', and that's OK even if 'a:/never/never/land' does not and cannot exist. Second, the file system in question was a Fedora tmpfs file system mounted via CIFS, and this specific file system (tmpfs) does allow ':' in file names. CIFS should not arbitrarily exclude ':' when both client and server allow ':' in file names.
(In reply to Paul Eggert from comment #12) > (In reply to Charles R. Anderson from comment #11) > > > How is using a character that isn't allowed on a specific filesystem > > considered to be a bug in that filesystem? > > First, the contents of a symbolic link do not have to be a file name, which > means that file system restrictions are irrelevant in symlink contents. I > can create a symbolic link from 'foo' to 'a:/never/never/land', and that's > OK even if 'a:/never/never/land' does not and cannot exist. > > Second, the file system in question was a Fedora tmpfs file system mounted > via CIFS, and this specific file system (tmpfs) does allow ':' in file > names. CIFS should not arbitrarily exclude ':' when both client and server > allow ':' in file names. Okay, I'll clone this bug for samba then, but leave this one as-is so the emacs workaround can be released for Fedora. We need the workaround since Samba servers won't necessarily be upgraded on the same schedule as Fedora clients.
To make clear: this is not a samba bug. It is a cifs.ko bug, e.g. kernel side.
Please apply this patch to emacs and relase updates for all supported Fedora releases: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1dd54e3eef7543720eff161457677a35fae2435c Thanks!
I'm already working on it. Also, after comment#9, you can see that I have already created a bug for samba. Please, leave this bug on emacs.
emacs-25.1-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b839b149bf
emacs-25.1-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3c06e0bcf6
emacs-25.1-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
emacs-25.1-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.