Overwriting destroys versioning

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
Matthias01
Posts: 7
Joined: 06 Jan 2014, 10:00

Overwriting destroys versioning

Post by Matthias01 »

Hi,

first of all: Thank you for this nice little piece of software. I'm a registered user of Salamander for many years and over all I am very satisfied with your file-manager.

But currently I have big problem with Salamander which I am not able to solve: When I try to move or copy a file to a mounted network drive (a WebDAV share mounted in windows 7 to a network drive) I got the standard question whether to overwrite the file or not. If I hit yes, it seems that the file was overwritten as usual. But in background it seems, that Salamander first deletes the file before copying it to the share. That's at least that what the sever log shows. For me and my colleagues this is a big problem because we use versioning for a lot of files on this server. But in this case all existing versions for this one file are destroyed because the command order from Salamander (Server first deletes the file - inluding all versions in the background and during the 2nd step he gets a new file; means he starts with Version 1...).
This Problem exists within the latest stable version as well with the latest Beta.

I hope you could help me with this issue. I don't want to use the windows explorer (which works) just for this scenario.

Thanks in advance, cheers Matthias
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Re: Overwriting destroys versioning

Post by Petr Solin »

I have looked to source code and it seems that Salamander is overwriting files as expected (except few special buggy situations when it is not possible, which is not your case I expect, in these cases target file must be deleted and newly created). File is opened with truncate (CreateFile with CREATE_ALWAYS, from MSDN: Creates a new file. If the file exists, the function overwrites the file and clears the existing attributes.) and then new data is written. You can use Process Monitor to see what really happens to your file (or send us exported log from Process Monitor and we will look at it). Try to search DeleteFile API function.

What software are you using to connect your WebDAV share to Win7? It may be working only with Explorer (use some its hooks, etc.).
Matthias01
Posts: 7
Joined: 06 Jan 2014, 10:00

Re: Overwriting destroys versioning

Post by Matthias01 »

Hey Petr,

thanks for your fast reply.
To connect to the WebDav Share I don't use any special software. It's done with the standard windows feature "Connect Network Share". Instead of entering an UNC path I enter the WebDav URL and assign a drive letter.

If I copy then a file with the windows explorer to the share it's all good, but not with Salamander (like described).

For using Procecess Monitor unfortunately I have no time, but if you need it for debuging I can do it next week.

Best - Matthias
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Re: Overwriting destroys versioning

Post by Petr Solin »

When you open some text file from this WebDAV mapped drive in text editor (like notepad.exe or better some other non-MS plain text editor like SciTE) and change something and use Save command, how does it behave? Is it adding versions or is it deleting older versions and keeps only the last saved version? Thanks for tests!

We are not using WebDAV. Can someone else confirm this problem or advise how to solve it?
Matthias01
Posts: 7
Joined: 06 Jan 2014, 10:00

Re: Overwriting destroys versioning

Post by Matthias01 »

I tried to edit a text file with notepad --> all was working fine, like expected ;-)
I tried also to edit this file with SciTE --> nothing was working like expected :roll:
- saving the file with SciTE was looking like "All done" but in fact there was nothing saved (the original File of the Server was untouched (incl. versions))
- Windows shows instead a "balloon tip" with an error message that same data was not written firmly :cry:
I tried also a 2nd non-MS editor (Crimson Editor) --> this one was also not able to save the text file (but with an error message within the editor itself)

To put it in a nutshell: The versioning was not destroyed but non-MS text editors were not able to save the file successful.
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Re: Overwriting destroys versioning

Post by Petr Solin »

It's very interesting. So it seems MS software makes it different to make it work as expected. We should probably install it here and try to debug it. Unfortunately we have to make other thing now, so I'm giving this up for now. If someone else need to fix this, please leave us your votes here. Thanks!
User avatar
mdruiter
Posts: 262
Joined: 22 Feb 2006, 15:33
Location: Amsterdam, The Netherlands
Contact:

Re: Overwriting destroys versioning

Post by mdruiter »

Are you sure you're looking at the same file? Yes it looks like the same filename in the same location. But do you know about VirtualStore, a.k.a. UAC Virtualization or Data Redirection? Check:
http://blogs.windows.com/windows/archiv ... ction.aspx
That's why, if you write or change files in C:\Program Files\ as a normal user, they only 'physically' change in C:\Users\Username\AppData\Local\VirtualStore\Program Files\...

And did you know that what looks to 32 bit processes as C:\Windows\system32\, is actually, 'physically' C:\Windows\SysWOW64\? I bet recent Windows (Vista+) versions have more magic like this.

Depending on what programs 'know' about these relatively new effects, what actually happens could be very different from what you think or see happening. That's why you should run ProcMon: it will reveal what really happens. I hope that will clear your situation.
User avatar
Ether
Posts: 1471
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Re: Overwriting destroys versioning

Post by Ether »

Petr Solin wrote:We should probably install it here and try to debug it.
I've put together a minimal config file for Apache HTTPd (download here), hope it helps.

Create directory W:\davtest (or some else, but don't forget to change the config file), create subdirectories davtest\root, davtest\dav and extract binaries into davtest\httpd, so that you have davtest\httpd\bin\httpd.exe. Save the following into davtest\httpd.conf and run davtest\httpd\bin\httpd.exe -f davtest\httpd.conf.

Code: Select all

ServerRoot "W:/davtest/httpd"

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule socache_dbm_module modules/mod_socache_dbm.so
LoadModule setenvif_module modules/mod_setenvif.so

ServerAdmin admin@example.com
Listen 8080
PidFile "W:/davtest/httpd.pid"
DocumentRoot "W:/davtest/root"
Alias /dav "W:/davtest/dav"
DirectoryIndex index.html
DavLockDB "W:/davtest/davlock"
ErrorLog "W:/davtest/error.log"
LogLevel info
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "W:/davtest/access.log" common
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

<Location /dav>
	Require all granted
	Dav On
	DavDepthInfinity on
	Options All
</Location>

<Directory "W:/davtest/root">
	Require all granted
	Options All
</Directory>

<Files ".ht*">
	Require all denied
</Files>
Ελληνικά rulez.
Post Reply