Data corruption problems with direct open and then save of documents
Hello there,
I have long been a fan of SCP and have used it personally for quite a while on my Linux systems. I recently installed a test installation of WinSSHd on an XP server with XP clients using WinSCP 3.56 with the Explorer interface and have come across two issues that can cause data loss and/or corruption. I have also tested these issues on a Mandrake 9.0 Linux server and they respond the same way (which is to be expected).
- When the user double clicks (or selects open) a Word document, the document is transferred and opened in Word, after the user exits Word (and saves the document) it is then uploaded back to the server and is corrupted. I tested this with notepad and .TXT files and found that the CR/LF is being replaced with LF even though the default transfer mode is binary. Attached is the log file that shows this is also the case for the word Document
- When using the Explorer interface and the user performs a drag and drop to the Desktop or the "My Documents" folder, WinSCP attempts to perform a move rather then a copy. If the user blindly goes on with the process the file is moved from the server and could be lost forever. In my experience this type of process is typical of the user, particularly when they are familiar with using file servers in the office to obtain local copies of documents. I would like to completely disable the move feature so that a copy is the only option that could be performed for a session.
For my uses WinSCP has been an excellent tool. Unfortunately if I unleash this on my office mates and other uses as an alternate to VPN access I am assured that their natural Windows tendencies and usage patterns will cause loss of data.
Allen
**** Log from Open of "Test.txt"
File: "/home/allen/xfer/Test.txt"
Copying "/home/allen/xfer/Test.txt" to local directory started.
Binary transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 54787
Type: SSH_FXP_HANDLE, Size: 13, Number: 54787
Type: SSH_FXP_READ, Size: 25, Number: 55045
Status/error code: 1
3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 55556
Type: SSH_FXP_STATUS, Size: 24, Number: 55556
Status/error code: 0
Copying 1 files/directories to remote directory "/home/allen/xfer"
PrTime: Yes; PrRO: Yes; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: Yes; Resume: N (102400); CalcS: Yes; Mask: *.*
TM: A; AscM: *.*htm*; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
File: "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp01032\Test.txt"
Copying "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp01032\Test.txt" to remote directory started.
Ascii transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 55811
Type: SSH_FXP_HANDLE, Size: 13, Number: 55811
Type: SSH_FXP_WRITE, Size: 109, Number: 56070
1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 56324
Type: SSH_FXP_STATUS, Size: 24, Number: 56324
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 46, Number: 56585
Type: SSH_FXP_STATUS, Size: 24, Number: 56585
Status/error code: 0
Listing directory "/home/allen/xfer".
Type: SSH_FXP_OPENDIR, Size: 25, Number: 56843
Type: SSH_FXP_HANDLE, Size: 13, Number: 56843
Type: SSH_FXP_READDIR, Size: 13, Number: 57100
Type: SSH_FXP_NAME, Size: 431, Number: 57100
Type: SSH_FXP_READDIR, Size: 13, Number: 57356
Type: SSH_FXP_STATUS, Size: 28, Number: 57356
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 57604
Type: SSH_FXP_STATUS, Size: 24, Number: 57604
Status/error code: 0
**** Log from open of a TEST.DOC
File: "/home/allen/xfer/Test.doc"
Copying "/home/allen/xfer/Test.doc" to local directory started.
Binary transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 64003
Type: SSH_FXP_HANDLE, Size: 13, Number: 64003
Type: SSH_FXP_READ, Size: 25, Number: 64261
Status/error code: 1
19 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 66820
Type: SSH_FXP_STATUS, Size: 24, Number: 66820
Status/error code: 0
Copying 1 files/directories to remote directory "/home/allen/xfer"
PrTime: Yes; PrRO: Yes; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: Yes; Resume: N (102400); CalcS: Yes; Mask: *.*
TM: A; AscM: *.*htm*; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
File: "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp03403\Test.doc"
Copying "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp03403\Test.doc" to remote directory started.
Ascii transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 67075
Type: SSH_FXP_HANDLE, Size: 13, Number: 67075
Type: SSH_FXP_WRITE, Size: 4121, Number: 67334
9 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 68612
Type: SSH_FXP_STATUS, Size: 24, Number: 68612
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 46, Number: 68873
Type: SSH_FXP_STATUS, Size: 24, Number: 68873
Status/error code: 0
Listing directory "/home/allen/xfer".
Type: SSH_FXP_OPENDIR, Size: 25, Number: 69131
Type: SSH_FXP_HANDLE, Size: 13, Number: 69131
Type: SSH_FXP_READDIR, Size: 13, Number: 69388
Type: SSH_FXP_NAME, Size: 431, Number: 69388
Type: SSH_FXP_READDIR, Size: 13, Number: 69644
Type: SSH_FXP_STATUS, Size: 28, Number: 69644
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 69892
Type: SSH_FXP_STATUS, Size: 24, Number: 69892
Status/error code: 0
I have long been a fan of SCP and have used it personally for quite a while on my Linux systems. I recently installed a test installation of WinSSHd on an XP server with XP clients using WinSCP 3.56 with the Explorer interface and have come across two issues that can cause data loss and/or corruption. I have also tested these issues on a Mandrake 9.0 Linux server and they respond the same way (which is to be expected).
- When the user double clicks (or selects open) a Word document, the document is transferred and opened in Word, after the user exits Word (and saves the document) it is then uploaded back to the server and is corrupted. I tested this with notepad and .TXT files and found that the CR/LF is being replaced with LF even though the default transfer mode is binary. Attached is the log file that shows this is also the case for the word Document
- When using the Explorer interface and the user performs a drag and drop to the Desktop or the "My Documents" folder, WinSCP attempts to perform a move rather then a copy. If the user blindly goes on with the process the file is moved from the server and could be lost forever. In my experience this type of process is typical of the user, particularly when they are familiar with using file servers in the office to obtain local copies of documents. I would like to completely disable the move feature so that a copy is the only option that could be performed for a session.
For my uses WinSCP has been an excellent tool. Unfortunately if I unleash this on my office mates and other uses as an alternate to VPN access I am assured that their natural Windows tendencies and usage patterns will cause loss of data.
Allen
**** Log from Open of "Test.txt"
File: "/home/allen/xfer/Test.txt"
Copying "/home/allen/xfer/Test.txt" to local directory started.
Binary transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 54787
Type: SSH_FXP_HANDLE, Size: 13, Number: 54787
Type: SSH_FXP_READ, Size: 25, Number: 55045
Status/error code: 1
3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 55556
Type: SSH_FXP_STATUS, Size: 24, Number: 55556
Status/error code: 0
Copying 1 files/directories to remote directory "/home/allen/xfer"
PrTime: Yes; PrRO: Yes; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: Yes; Resume: N (102400); CalcS: Yes; Mask: *.*
TM: A; AscM: *.*htm*; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
File: "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp01032\Test.txt"
Copying "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp01032\Test.txt" to remote directory started.
Ascii transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 55811
Type: SSH_FXP_HANDLE, Size: 13, Number: 55811
Type: SSH_FXP_WRITE, Size: 109, Number: 56070
1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 56324
Type: SSH_FXP_STATUS, Size: 24, Number: 56324
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 46, Number: 56585
Type: SSH_FXP_STATUS, Size: 24, Number: 56585
Status/error code: 0
Listing directory "/home/allen/xfer".
Type: SSH_FXP_OPENDIR, Size: 25, Number: 56843
Type: SSH_FXP_HANDLE, Size: 13, Number: 56843
Type: SSH_FXP_READDIR, Size: 13, Number: 57100
Type: SSH_FXP_NAME, Size: 431, Number: 57100
Type: SSH_FXP_READDIR, Size: 13, Number: 57356
Type: SSH_FXP_STATUS, Size: 28, Number: 57356
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 57604
Type: SSH_FXP_STATUS, Size: 24, Number: 57604
Status/error code: 0
**** Log from open of a TEST.DOC
File: "/home/allen/xfer/Test.doc"
Copying "/home/allen/xfer/Test.doc" to local directory started.
Binary transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 64003
Type: SSH_FXP_HANDLE, Size: 13, Number: 64003
Type: SSH_FXP_READ, Size: 25, Number: 64261
Status/error code: 1
19 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 66820
Type: SSH_FXP_STATUS, Size: 24, Number: 66820
Status/error code: 0
Copying 1 files/directories to remote directory "/home/allen/xfer"
PrTime: Yes; PrRO: Yes; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: Yes; Resume: N (102400); CalcS: Yes; Mask: *.*
TM: A; AscM: *.*htm*; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
File: "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp03403\Test.doc"
Copying "C:\DOCUME~1\ASuski\LOCALS~1\Temp\scp03403\Test.doc" to remote directory started.
Ascii transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 42, Number: 67075
Type: SSH_FXP_HANDLE, Size: 13, Number: 67075
Type: SSH_FXP_WRITE, Size: 4121, Number: 67334
9 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 68612
Type: SSH_FXP_STATUS, Size: 24, Number: 68612
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 46, Number: 68873
Type: SSH_FXP_STATUS, Size: 24, Number: 68873
Status/error code: 0
Listing directory "/home/allen/xfer".
Type: SSH_FXP_OPENDIR, Size: 25, Number: 69131
Type: SSH_FXP_HANDLE, Size: 13, Number: 69131
Type: SSH_FXP_READDIR, Size: 13, Number: 69388
Type: SSH_FXP_NAME, Size: 431, Number: 69388
Type: SSH_FXP_READDIR, Size: 13, Number: 69644
Type: SSH_FXP_STATUS, Size: 28, Number: 69644
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 69892
Type: SSH_FXP_STATUS, Size: 24, Number: 69892
Status/error code: 0