leafpad erases files over SMB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
leafpad (Debian) |
New
|
Unknown
|
|||
leafpad (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Whenever you edit a text file on an SMB share, leafpad erases the entire file instead of saving your edits. I mention this to the lubuntu group, since leafpad is the default program associated with file extensions such as .txt and thus very likely to be where new users start editing such files. But in fact, they will be silently erasing those files contents. No other applications seem to have this problem over the SMB share, and I tested to 2 different smb shares, one a NAS4Free server running samba, the other a commercial NAS .
As a work around I uninstalled leafpad and installed mousepad, then associated files types with mousepad. I encourage the lubuntu group to look into fixing this issue in Leafpad, or switching the default graphical text editor to something else.
sudo apt-get remove leafpad
sudo apt-get install mousepad
Leafpad doesn't seem to be under much development lately, though I have not contacted the author:
http://
Others have noticed this problem with leafpad in general:
FS#44681 - [leafpad] wipest content of text files on smb when saving
https:/
Samba erases content of files when saving
http://
I am happy to help test this problem further, just drop me a line. If there is a better place for me to post this info / request let me know.
Mark Bertolina
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: leafpad 0.8.18.1-4
ProcVersionSign
Uname: Linux 4.2.0-27-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
Date: Thu Feb 4 18:29:30 2016
ProcEnviron:
LANGUAGE=en_US
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: leafpad
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | added: patch |
Changed in leafpad (Debian): | |
status: | Unknown → New |
I confirmed this happens on SFTP connections as well as SMB, and seems to only occur on text files less than 4096 bytes. Yes this is a dangerous bug - I was just lucky to notice before losing important notes.
If you reverse lines 232 & 233 in src/file.c so that it becomes: buffer_ set_modified( buffer, FALSE);
fclose(fp);
gtk_text_
and recompile it seems to fix the bug - the files save correctly.